開発環境 |
Microsoft Visual C++ 2010 Express (SP1) |
実行環境 |
Microsoft Windows XP Home Edition (SP3) |
プロジェクトの種類 |
空の CLR プロジェクト |
プロジェクト名 |
clrclass |
clrclass.cpp
/*
#pragmaは以下のプロジェクトプロパティと同等
構成プロパティ→リンカー
→システム→サブシステム:Windows (/SUBSYSTEM:WINDOWS)
→詳細設定→エントリ ポイント:Hello::main
*/
#pragma comment(linker, "/subsystem:windows")
#pragma comment(linker, "/entry:Hello::main")
#using <System.Windows.Forms.dll>
using namespace System::Windows::Forms;
public ref class Hello
{
private:
void Message()
{
MessageBox::Show("hello, world");
}
public:
static int main()
{
Hello^ hello = gcnew Hello();
hello->Message();
return 0;
}
};
最終更新:2012年09月17日 18:07