CWinApp::GetProfileInt

UINT GetProfileInt( LPCTSTR lpszSection, LPCTSTR lpszEntry, int nDefault );

Return Value

The integer value of the string that follows the specified entry if the function is successful. The return value is the value of the nDefault parameter if the function does not find the entry. The return value is 0 if the value that corresponds to the specified entry is not an integer.

This member function supports hexadecimal notation for the value in the .INI file. When you retrieve a signed integer, you should cast the value into an int.

Parameters

lpszSection

Points to a null-terminated string that specifies the section containing the entry.

lpszEntry

Points to a null-terminated string that contains the entry whose value is to be retrieved.

nDefault

Specifies the default value to return if the framework cannot find the entry. This value can be an unsigned value in the range 0 through 65,535 or a signed value in the range –32,768 through 32,767.

Remarks

Call this member function to retrieve the value of an integer from an entry within a specified section of the application’s registry or .INI file.

The entries are stored as follows:

This member function is not case sensitive, so the strings in the lpszSection and lpszEntry parameters may differ in case.

CWinApp OverviewClass MembersHierarchy Chart

See Also   CWinApp::GetProfileString, CWinApp::WriteProfileInt, ::GetPrivateProfileInt