LRESULT MyDlg::wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG : { return FALSE; } case WM_COMMAND : { switch(wParam) { case IDOK : { ::MessageBox(*this,_T("demo"),_T("about:"),0); endDlg(0); return TRUE; } case IDCANCEL : { endDlg(0); return TRUE; } } } } return BaseWindowType::wndProc(hwnd,message,wParam,lParam); }
void unloadApp() { DetachEdReactor(); if(gpDocReactor) { acDocManager->removeReactor(gpDocReactor); delete gpDocReactor; } endDlg(); acedRegCmds->removeGroup ("ASDK_MODELESS"); }
// // Attach the database reactor if one isn't attached already. // Then, start up the dialog. // // void attachDbReactor(AcDbDatabase* pDb) { if(gbDisplayDialog) { AcDbDatabase* pWkDb = acdbHostApplicationServices()->workingDatabase(); assert(pWkDb == pDb); AcDbDatabase* pCurDb = curDoc()->database(); assert(pCurDb == pDb); acDocManager->lockDocument(curDoc(), AcAp::kWrite); gpDbReactor = new CDbModReactor(); pWkDb->addReactor(gpDbReactor); acutPrintf("\nAttached CDbModReactor to the current database.\n"); acDocManager->unlockDocument(curDoc()); acedPostCommandPrompt(); } else endDlg(); }