请问添加了"向MFC添加ATL支持"后, 如何编写程序呢? 譬如在mobile 5 sdk中ATL目录 ..\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\ATL\Minipie\MiniPIE 该程序是用ATL写的,请问它的主入口是什么?如何将其去掉后按照上面的方法放到MFC工程中去呢?可以将上面的程序放置在MFC中的什么位置呢? 谢谢
// WinMain int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int CmdShow) { #ifdef WINCE #ifdef DEBUG // Lets give VS2005 some time to be able to attach to this process with debugger int sleep_timeout = (lpCmdLine&&lpCmdLine[0])?_ttoi( lpCmdLine ):0; // 0s is default Sleep( sleep_timeout ); #endif // DEBUG #endif // WINCE
// Check if one instance is already running. const HANDLE hMutex = ::CreateMutex(NULL, FALSE, g_szUniqueString);
if(NULL != hMutex) { if(ERROR_ALREADY_EXISTS == ::GetLastError()) { // This is not the first instance of the application. // Activate the firsty instance and exit. const HWND hWndExistingInstance = ::FindWindow(g_szUniqueString, NULL);
// Init common controls // TODO: remove unused controls INITCOMMONCONTROLSEX comctrex; comctrex.dwSize = sizeof(comctrex); comctrex.dwICC = ICC_UPDOWN_CLASS ¦ ICC_DATE_CLASSES // date and time-picker control ¦ ICC_PROGRESS_CLASS // progress bar control ¦ ICC_LISTVIEW_CLASSES // list view and header control ¦ ICC_TREEVIEW_CLASSES; // tree view control ::InitCommonControlsEx(&comctrex);
// WinMain int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int CmdShow) { #ifdef WINCE #ifdef DEBUG // Lets give VS2005 some time to be able to attach to this process with debugger int sleep_timeout = (lpCmdLine&&lpCmdLine[0])?_ttoi( lpCmdLine ):0; // 0s is default Sleep( sleep_timeout ); #endif // DEBUG #endif // WINCE
// Check if one instance is already running. const HANDLE hMutex = ::CreateMutex(NULL, FALSE, g_szUniqueString);
if(NULL != hMutex) { if(ERROR_ALREADY_EXISTS == ::GetLastError()) { // This is not the first instance of the application. // Activate the firsty instance and exit. const HWND hWndExistingInstance = ::FindWindow(g_szUniqueString, NULL);
// Init common controls // TODO: remove unused controls INITCOMMONCONTROLSEX comctrex; comctrex.dwSize = sizeof(comctrex); comctrex.dwICC = ICC_UPDOWN_CLASS ¦ ICC_DATE_CLASSES // date and time-picker control ¦ ICC_PROGRESS_CLASS // progress bar control ¦ ICC_LISTVIEW_CLASSES // list view and header control ¦ ICC_TREEVIEW_CLASSES; // tree view control ::InitCommonControlsEx(&comctrex);