For Example:
Step1: Defining a string in VS String Table
ID Value Caption
IDS_STRTEST 101 How to use string defined in String Table
IDS_STRTEST 101 How to use string defined in String Table
Step2 Test it in a CLI Console Application
#include
"
atlbase.h
"
#include " resource.h "
int main(array < System::String ^> ^ args)
... {
// Declare a CComBSTR object
CComBSTR bsTableString;
// load string from string table
bsTableString.LoadString ( IDS_STRTEST );
// Convert the string into an ANSI string
CW2CT szMyString( bsTableString );
// Display the ANSI string
MessageBox( NULL, szMyString, _T("String Test"), MB_OK );
return 0;
}
#include " resource.h "
int main(array < System::String ^> ^ args)
... {
// Declare a CComBSTR object
CComBSTR bsTableString;
// load string from string table
bsTableString.LoadString ( IDS_STRTEST );
// Convert the string into an ANSI string
CW2CT szMyString( bsTableString );
// Display the ANSI string
MessageBox( NULL, szMyString, _T("String Test"), MB_OK );
return 0;
}