在基于base dialog的开发中为什么找不到WinMain函数,该怎么解决

在基于base dialog的开发中为什么找不到WinMain函数
另外如何在基于base   dialog的设计中做一个关闭窗口的按钮

------解决方案--------------------
基于mfc的程序的winmain都由mfc实现,不需要程序员显式实现
winmain在appmodul.cpp中实现

extern "C " int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
// call shared/exported WinMain
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}

AfxWinMain在winmain.cpp中实现

/////////////////////////////////////////////////////////////////////////////
// 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

AfxWinTerm();
return nReturnCode;
}

详细的知识请参考深入潜出MFC