int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/) { appInstance = hInstance; OleInitialize(NULL); INITCOMMONCONTROLSEX icx; icx.dwSize = sizeof(INITCOMMONCONTROLSEX); icx.dwICC = ICC_DATE_CLASSES | ICC_LISTVIEW_CLASSES|ICC_WIN95_CLASSES; InitCommonControlsEx(&icx); resInstance = LoadLibrary(_T("TaskRes.dll")); CryptoUtil::GetCryptoUtil(); NetInit(); DataManager * pMM = DataManager::Get(); // hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_XMLTREE); CTaskMainWnd *pAppWnd = new CTaskMainWnd(hInstance, pMM); RECT r = { pMM->GetConfiguration()->GetConfigurationInt(_T("mainWindowLeft"), 40), pMM->GetConfiguration()->GetConfigurationInt(_T("mainWindowTop"), 40), pMM->GetConfiguration()->GetConfigurationInt(_T("mainWindowRight"), 750), pMM->GetConfiguration()->GetConfigurationInt(_T("mainWindowBottom"), 550) }; mainAppHWND = pAppWnd->Create(NULL, r, WS_OVERLAPPEDWINDOW | WS_VISIBLE); MSG msg; ZeroMemory(&msg, sizeof(MSG)); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { //TODO: review why translate accelerator is not being used.. // if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) // { TranslateMessage(&msg); DispatchMessage(&msg); // } } pMM->Save(pMM->GetFileManager()->GetUserPlanFilename()); delete pAppWnd; mainAppHWND = NULL; NetConclude(); OleUninitialize(); return msg.wParam; }