Hello, Win32 API(C++/CLI) World!

Posted on 4月 15th, 2012 by cx20

Win32 API(C++/CLI)

Win32 API は、Windows の機能にアクセスする為の API(Application Programming Interface)である。
以下は C++/CLI からの呼出し例である。

ソースコード

#include <windows.h>
#include <tchar.h>
 
int _tmain( int argc, TCHAR* argv[] )
{
    MessageBox( NULL, _T("Hello, Win32 API(C++/CLI) World!"), _T("Hello, World!"), MB_OK );
    return 0;
}

コンパイル方法(Visual C++)

C:¥> cl hello.cpp /clr /link user32.lib

実行結果

---------------------------
Hello, World!
---------------------------
Hello, Win32 API(C++/CLI) World!
---------------------------
OK   
---------------------------

Tags:

Categories: C++/CLI, library, Win32 API

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

WP-SpamFree by Pole Position Marketing