如题。void CConnectDialog::OnOK()
{
// Save entries to .ini for next use
AfxGetApp()->WriteProfileString(szSection, szHostName, m_strHostName); AfxGetApp()->WriteProfileString(szSection, szPort, m_strPort); AfxGetApp()->WriteProfileString("AAAAAA","BBBB","CCCC");
CDialog::OnOK();
}
但是在对话框的OnInitDialog函数中又能得到,这是怎么回事的????BOOL CConnectDialog::OnInitDialog()
{
CDialog::OnInitDialog(); // Restore previous selections m_strHostName = AfxGetApp()->GetProfileString(szSection, szHostName);
m_strPort     = AfxGetApp()->GetProfileString(szSection, szPort);
UpdateData(FALSE);
return TRUE;
}

解决方案 »

  1.   

    WriteProfileString是写到系统目录下了,你要用WritePrivateProfileString,这样就可以写到自己定义的任意目录下。
      

  2.   

    AfxGetApp()->WriteProfileString
    是写到注册表里去了
      

  3.   

    Res
    The entries are stored as follows:
    In Windows NT, the value is stored to a registry key.
    In Windows 3.x, the value is stored in the WIN.INI file.
    In Windows 95/98, the value is stored in a cached version of WIN.INI.
      

  4.   

    在HKEY_CURRENT_USER\Software下找找看