共用方式為


CWinAppEx::GetInt

Reads integer data from a specified registry key.

int GetInt(
   LPCTSTR lpszEntry,
   int nDefault = 0
);

Parameters

  • [in] lpszEntry
    A string that contains the name of a registry entry.

  • [in] nDefault
    The default value that the method returns if the specified registry entry does not exist.

Return Value

The registry data if the method was successful; otherwise nDefault.

Remarks

This method reads integer data from the registry. If there is no integer data associated with the registry key indicated by lpszEntry, this method returns nDefault. To write data to the registry, use the methods CWinAppEx::WriteSectionInt and CWinAppEx::WriteInt.

The lpszEntry parameter is the name of a registry entry located under the default registry key for your application. To get or set the default registry key, use the methods CWinAppEx::GetRegistryBase and CWinAppEx::SetRegistryBase respectively.

Requirements

Header: afxwinappex.h

See Also

Reference

CWinAppEx Class

Hierarchy Chart

CWinAppEx::WriteInt

CWinAppEx::WriteSectionInt