博客首页 注册 建议与交流 排行榜 加入友情链接         宝宝相册的专门空间
推荐 投诉 搜索: 帮助

苦丁茶

tomcent.cublog.cn
D语言GUI

import std.c.windows.windows;

extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void _minit();
extern (C) void _moduleCtor();
extern (C) void _moduleDtor();
extern (C) void _moduleUnitTests();

extern (Windows)
int WinMain(HINSTANCE hInstance,
 HINSTANCE hPrevInstance,
 LPSTR lpCmdLine,
 int nCmdShow)
{
    int result;

    gc_init(); // initialize garbage collector

    _minit(); // initialize module constructor table


    try
    {
 _moduleCtor(); // call module constructors

 _moduleUnitTests(); // run unit tests (optional)


 result = myWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);

 _moduleDtor(); // call module destructors

    }

    catch (Object o) // catch any uncaught exceptions

    {
 MessageBoxA(null, cast(char *)o.toString(), "Error",
      MB_OK | MB_ICONEXCLAMATION);
 result = 0; // failed

    }

    gc_term(); // run finalizers; terminate garbage collector

    return result;
}

int myWinMain(HINSTANCE hInstance,
 HINSTANCE hPrevInstance,
 LPSTR lpCmdLine,
 int nCmdShow)
{
    /* ... insert user code here ... */
 MessageBoxA(null, "HelloWorld", "MSG",MB_OK | MB_ICONEXCLAMATION);
 //就这行是我写的,其他都是英文说明上的

 return 1;
}


使用Poseidon 编辑器进行编辑

发表于: 2008-01-06,修改于: 2008-01-06 23:40,已浏览260次,有评论0条 推荐 投诉

给我留言
版权所有 ChinaUnix.net 页面生成时间:7.38758