CComBSTR::LoadString

Carica una risorsa di tipo stringa specificata da nID e memorizzata in questo oggetto.

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

Parametri

Vedere LoadString in Windows SDK.

Valore restituito

Restituisce true se la stringa venga caricata; in caso contrario, restituisce false.

Note

La prima funzione carica la risorsa dal modulo identificato dall'utente tramite il parametro hInst.La seconda funzione carica la risorsa dal modulo di risorse associato a CComModuleoggetto derivato da utilizzato in questo progetto.

Esempio

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

Requisiti

Header: atlbase.h

Vedere anche

Riferimenti

CComBSTR (classe)

Altre risorse

ATL and MFC String Conversion Macros