Shared Visual C++ Classes Reference 
CStringT::LoadString 

Reads a Windows string resource, identified by nID, into an existing CStringT object.

BOOL LoadString(
   HINSTANCE hInstance,
   UINT nID,
   WORD wLanguageID
);
BOOL LoadString(
   HINSTANCE hInstance,
   UINT nID
);
BOOL LoadString(
   UINT nID
);

Parameters

hInstance

A handle to the instance of the module.

nID

A Windows string resource ID.

wLanguageID

The language of the string resource.

Return Value

Nonzero if resource load was successful; otherwise 0.

Remarks

Loads the string resource (nID) from the specified module (hInstance) using the specified language (wLanguage).

Example

#define IDS_FILENOTFOUND 1
//typedef CStringT< TCHAR, StrTraitATL< TCHAR > > CAtlString;

CAtlString s;
s.LoadString( IDS_FILENOTFOUND );

For another example, see ShowLocalized.

See Also

Reference

CStringT Class

Other Resources

CStringT Members

Tags :


Community Content

Giovanni Dicanio
LoadString can load strings with embedded nulls, but your wrapper function might not
Interesting blog post:

LoadString can load strings with embedded nulls, but your wrapper function might not

http://blogs.msdn.com/oldnewthing/archive/2009/10/09/9904648.aspx

Tags :

Page view tracker