大龙的博客

常用链接

统计

最新评论

DisableThreadLibraryCalls

BOOL WINAPI DllEntryPoint(HINSTANCE hInstance, ULONG ulReason, LPVOID pv)
{
    switch (ulReason)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hInstance); // 取消DLL_THREAD_ATTACH和DLL_THREAD_DETACH的通知消息
        DbgInitialise(hInstance);// 准备Debug信息
        g_amPlatform = VER_PLATFORM_WIN32_WINDOWS; // win95 assumed in case GetVersionEx fails
        g_osInfo.dwOSVersionInfoSize = sizeof(g_osInfo);
        if (GetVersionEx(&g_osInfo)) {g_amPlatform = g_osInfo.dwPlatformId; }
        else {
           DbgLog((LOG_ERROR, 1, TEXT("Failed to get the OS platform, assuming Win95")));}
        g_hInst = hInstance;
        DllInitClasses(TRUE);
        break;
    case DLL_PROCESS_DETACH:
        DllInitClasses(FALSE);
        break;
    }
}

posted on 2009-03-03 16:44 大龙 阅读(2664) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理