CComBSTR::LoadString

bool LoadString( HINSTANCE hInst, UINT nID );

bool LoadString( UINT nID );

Return Value

Returns true if the string is successfully loaded. Otherwise, this function returns false.

Parameters

See LoadString in the Win32 SDK.

Remarks

Loads a string resource specified by HINSTANCE, and stores it in this object. The first function uses the hInst supplied by you. The second function uses the m_hInstResource member of CComModule.

Example

// make sure atlconv.h is included
USES_CONVERSION;
CComBSTR bstrTemp;

//IDS_PROJNAME proj name stored as resource in string table
bstrTemp.LoadString(IDS_PROJNAME);

// the above is equivalent to:
// bstrTemp.LoadString(_Module.m_hInstResource, IDS_PROJNAME);

// display message box w/ proj name as title & text
::MessageBox(NULL, W2A(bstrTemp), W2A(bstrTemp), MB_OK);

CComBSTR OverviewClass Members