正在加载图片...
Visual c++ 这是因为MFC考虑到典型的 Windows程序需要的大部分初始化工作都是标准化的,因此把 WinMain函数隐藏在应用程序的框架中,编译时会自动将该函数链接到可执行文件中 在Ⅴ isual c++6.0安装目录下的“ Microsoft visual StudiolVO98MFC\SRC”路径中,会发现有 个源文件“ WinMain. cpp”,其中定义了入口函数 Afx WinMain,文件清单如下: #include"stdafx EX CORE 1 #pragma code seg(AFX COREl SEG) #end主 //////1/1/ / standard WinMain implementation // Can be replaced as long as 'AfxwinInit' is called first int AEXAPI AfxwinMain(HINSTANCE hInstance, HINSTANCe hPrevInstance, LPTSTR lpCmdLine, int ncmdshow) ASSERT (hPrevInstan NULL) Returncode cwinThread* pThread= AfxGetThread() cwinApp* pApp AfxGetApp()i / AEx internal initialization if (! AfxwinInit(hInstance, hPrevInstance, lpCmdLine, nCmdshow)) goto InitFailure / App global initializations (rare) if (pApp ! NULL &&!pApp->InitApplication() goto InitEailurei / Perform specific initializations if ( pThread->InitInstance()) if (pThread->m pMainwnd ! NULL TRACEO("Warning: Destroying non-NULL m pMainwnd \n")i pThread->m pMainWnd->Destroywindow( goto InitFailure nReturncode pThread->Run()i Initfailure #主 fdef DEB / check for missing AfxLockTempMap calls if (AfxGetModuleThreadstate()->m nTempMapLock ! =0) TRACEl("Warni. Temp map lock count non-zero (sld).\ AfxGetModuleThreadstate()->m nTempMapLock) AfxLockTempMaps ( AfxUnlockTempMaps(-1)i 励志照亮人生编程改变命运这是因为MFC考虑到典型的Windows程序需要的大部分初始化工作都是标准化的,因此把 WinMain函数隐藏在应用程序的框架中,编译时会自动将该函数链接到可执行文件中。 在Visual C++6.0安装目录下的“Microsoft Visual Studio\VC98\MFC\SRC”路径中,会发现有一 个源文件“WinMain.cpp”,其中定义了入口函数AfxWinMain,文件清单如下: #include "stdafx.h" #ifdef AFX_CORE1_SEG #pragma code_seg(AFX_CORE1_SEG) #endif ///////////////////////////////////////////////////////////////////////////// // Standard WinMain implementation // Can be replaced as long as 'AfxWinInit' is called first int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { ASSERT(hPrevInstance == NULL); int nReturnCode = -1; CWinThread* pThread = AfxGetThread(); CWinApp* pApp = AfxGetApp(); // AFX internal initialization if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow)) goto InitFailure; // App global initializations (rare) if (pApp != NULL && !pApp->InitApplication()) goto InitFailure; // Perform specific initializations if (!pThread->InitInstance()) { if (pThread->m_pMainWnd != NULL) { TRACE0("Warning: Destroying non-NULL m_pMainWnd\n"); pThread->m_pMainWnd->DestroyWindow(); } nReturnCode = pThread->ExitInstance(); goto InitFailure; } nReturnCode = pThread->Run(); InitFailure: #ifdef _DEBUG // Check for missing AfxLockTempMap calls if (AfxGetModuleThreadState()->m_nTempMapLock != 0) { TRACE1("Warning: Temp map lock count non-zero (%ld).\n", AfxGetModuleThreadState()->m_nTempMapLock); } AfxLockTempMaps(); AfxUnlockTempMaps(-1); #endif 40 励志照亮人生 编程改变命运 零基础学 Visual C++
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有