2.2.5.3.2 Registry::DelValue

Description

Removes a named value from the specified registry key.

Syntax

BOOL DelValue( LPCSTR lpSubKey, LPCSTR lpValueName = NULL )

Parameters

lpSubKey
[input] Pointer to a null-terminated string specifying the name of the key to delete. This parameter cannot be NULL.
lpValueName
[input]Pointer to a null-terminated string that names the value to remove.
If this parameter is NULL or points to an empty string, the value set by the SetValue function is removed.

Return

Examples

EX1

void Registry_DelValue_ex1()
{
    Registry myRegAccess(HKEY_CURRENT_USER);
    
    string strKey = GetRegKey() + "\\Dialogs\\Set Values";
    string strValue = "AutoUpdate";
    
    string strVal;
    if( myRegAccess.GetValue(strKey, strValue, strVal) ) // if the value is existed
    {
        if( myRegAccess.DelValue(strKey, strValue) )
        	out_str("Value deleted!");
    }
}

Remark

See Also

Registry::Registry, Registry::GetValue, GetRegKey

Header to Include

origin.h