For Example:
Step1: Defining a string in VS String Table
ID Value Caption
IDS_STRTEST 101 How to use string defined in String TableStep2 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;
}
本文介绍如何在Visual Studio的StringTable中定义并使用字符串资源。通过具体步骤演示了从定义字符串到在C++ CLI控制台应用程序中加载及显示的过程。
31万+

被折叠的 条评论
为什么被折叠?



