Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CRegKey::SetKeyValue

 

Call this method to store data in a specified value field of a specified key.


      LONG SetKeyValue(
   LPCTSTR lpszKeyName,
   LPCTSTR lpszValue,
   LPCTSTR lpszValueName = NULL 
) throw( );

lpszKeyName

Specifies the name of the key to be created or opened. This name must be a subkey of m_hKey.

lpszValue

Specifies the data to be stored. This parameter must be non-NULL.

lpszValueName

Specifies the value field to be set. If a value field with this name does not already exist in the key, it is added.

If successful, returns ERROR_SUCCESS; otherwise, a nonzero error code defined in WINERROR.H.

Call this method to create or open the lpszKeyName key and store the lpszValue data in the lpszValueName value field.

Requirements

Header: atlbase.h

Show: