请问SetRegistryKey这个函数有什么用处

解决方案 »

  1.   

    MSDN原文:
    void SetRegistryKey( LPCTSTR lpszRegistryKey );
    void SetRegistryKey( UINT nIDRegistryKey );Parameters
    lpszRegistryKey
    Pointer to a string containing the name of the key.nIDRegistryKey
    ID/index of a key in the registry.Res
    Causes application settings to be stored in the registry instead of INI files. This function sets m_pszRegistryKey, which is then used by the GetProfileInt, GetProfileString, WriteProfileInt, and WriteProfileString member functions of CWinApp. If this function has been called, the list of most recently-used (MRU) files is also stored in the registry. The registry key is usually the name of a company. It is stored in a key of the following form: HKEY_CURRENT_USER\Software\<company name>\<application name>\<section name>\<value name>.翻译过来大概意思就是说使程序的配置保存在注册表的指定键里,为GetProfileString, WriteProfileInt, WriteProfileString这三个CWinApp的成员函数提供位置。例如在App的InitInstance里加了SetRegistryKey("MyArena"),
    WriteProfileString, GetProfileString等就会从HKEY_CURRENT_USER\Software\MyArena下读写。
      

  2.   

    这类问题多看看MSDN就可以解决