Поделиться через


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.

Пример

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);   

Требования

Header: atlcomcli.h

См. также

Основные понятия

CComBSTR Class

CComBSTR Members

CComBSTR Members