How to load a string from string table
LoadString() function is used to load the string from a executable file, but this function is not working if I try to load a string from Library file( working fine with dll file).
For example I have executable named
1.exe which is linked with a library file 1.lib.
if i try to load a string from 1.lib using loadlibrary it is failing. Is their any way to load a string inside a library.
Please help
Re: How to load a string from string table
Use this line as the first line of your dll function that loads the String.
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
e.g.
void LoadString()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
CString str;
str.LoadString(IDS_MYSTR);
}
This should work