如题。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;
}
{
// 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;
}
是写到注册表里去了
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.