Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CComBSTR::LoadString

 

Loads a string resource specified by nID and stores it in this object.


      bool LoadString(
   HINSTANCE hInst,
   UINT nID 
) throw();
bool LoadString(
   UINT nID 
) throw();

See LoadString in the Windows SDK.

Returns true if the string is successfully loaded; otherwise, returns false.

The first function loads the resource from the module identified by you via the hInst parameter. The second function loads the resource from the resource module associated with the CComModule-derived object used in this project.

Example

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, CW2CT(bstrTemp), CW2CT(bstrTemp), MB_OK);   

Requirements

Header: atlbase.h

Show: