共用方式為


CWinAppEx::GetSectionObject

Reads CObject registry data from the registry.

BOOL GetSectionObject(
   LPCTSTR lpszSubSection,
   LPCTSTR lpszEntry,
   CObject& obj 
);

Parameters

  • [in] lpszSubSection
    A string that contains the relative path of a registry key.

  • [in] lpszEntry
    A string that contains the value to read.

  • [out] obj
    A reference to a CObject. The method uses this CObject to store the registry data.

Return Value

Nonzero if successful; otherwise 0.

Remarks

This method reads data from the registry. The data read is CObject data, or data for a class derived from CObject. To write CObject data to the registry, use either CWinAppEx::WriteObject or CWinAppEx::WriteSectionObject.

The lpszSubSection parameter is not an absolute path for a registry entry. It is a relative path that is appended to the end of 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::WriteObject

CWinAppEx::WriteSectionObject