BOOL CWinApp::WriteProfileInt( LPCTSTR lpszSection, LPCTSTR lpszEntry, int nValue );
....
   CString strSection       = "My Section";
   CString strStringItem    = "My String Item";
   CString strIntItem       = "My Int Item";
   CWinApp* pApp = AfxGetApp();
   pApp->WriteProfileString(strSection, strStringItem, "test");
   pApp->WriteProfileInt(strSection, strIntItem, 1234);
....

解决方案 »

  1.   

    如用RegSetValueEx()函数如何保存呢?
      

  2.   


    例如:
    RegSetValueEx(HKEY_CURRENT_USER, szValueName, 0, REG_DWORD, (CONST BYTE *)nValue, sizeof(DWORD));
      

  3.   

    DWORD setenableproxy=1;
    DWORD sizeofvalue=sizeof(DWORD);
    if(::RegSetValueEx(hkiesetting,"ProxyEnable",0,REG_DWORD,(BYTE *)&setenableproxy,sizeofvalue)!= ERROR_SUCCESS)
    return;
      

  4.   

    我可以提供一个读写注册表的类,很方便,若需要给Email