现在的位置: 首页 > 综合 > 正文

Handle CRT startup

2012年10月16日 ⁄ 综合 ⁄ 共 806字 ⁄ 字号 评论关闭

#include <windows.h>

#pragma comment(linker,"/ENTRY:__CRTStartup")

#ifdef _CONSOLE
#    ifdef _UNICODE
     extern "C" int wmainCRTStartup();
#    else
     extern "C" int mainCRTStartup();
#    endif
#else
#    ifdef _UNICODE
     extern "C" int wWinMainCRTStartup();
#    else
     extern "C" int WinMainCRTStartup();
# endif
#endif

int __CRTStartup()
{

#ifdef _CONSOLE
#    ifdef UNICODE
     wmainCRTStartup();
#    else  
     mainCRTStartup();
#    endif
#else
#    ifdef UNICODE
     wWinMainCRTStartup();
#    else  
     WinMainCRTStartup();
#    endif
#endif 

     return 0;
}

 

动态链接库版本: 

#pragma comment(linker,"/ENTRY:__CRTStartup")

extern "C" BOOL WINAPI _DllMainCRTStartup(HINSTANCE hDllHandle, DWORD dwReason, LPVOID lpReserved);

int __CRTStartup(HINSTANCE hDllHandle, DWORD dwReason, LPVOID lpReserved)

{

return _DllMainCRTStartup( (HINSTANCE)hDllHandle,dwReason,0);

抱歉!评论已关闭.