theEagles

I am sailing, to be with you, to be free.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

文章分类 -  VC/MFC

摘要:void CCATEngineAppDlg::OnCustomizeBinlogsDir(){ CString strBinLogs = CxApplicationINI::Instance()->GetProfileString(_T("Logger Settings"), _T("BinLogsDirectory"), _T("")); BROWSEINFO bi; TCHAR dispname[MAX_PATH], path[MAX_PATH]={0}; ITEMIDLIST* pidl; ZeroMemory(& 阅读全文

posted @ 2012-09-17 15:16 theEagles 阅读(294) 评论(0) 推荐(0)

摘要:一篇适合入门的文章:http://www.cnblogs.com/BoyXiao/archive/2011/01/02/1924188.html 阅读全文

posted @ 2012-09-11 23:03 theEagles 阅读(74) 评论(0) 推荐(0)

摘要:1. Add Message Function declaration to CMainFrame classafx_msg LRESULT OnGetTabToolTip(WPARAM wp, LPARAM lp);2. Implement Message Function to MainFrm.cppLRESULT CMainFrame::OnGetTabToolTip(WPARAM /*wp*/, LPARAM lp){ CMFCTabToolTipInfo* pInfo = (CMFCTabToolTipInfo*) lp; ASSERT(pInfo != NULL); ... 阅读全文

posted @ 2012-09-10 16:49 theEagles 阅读(551) 评论(0) 推荐(0)

摘要:在m_wndMenuBar.Create 之后添加如下两行,m_wndMenuBar.SetRecentlyUsedMenus (FALSE);m_wndMenuBar.SetShowAllCommands(TRUE);由于ShowAllCommands 和 RecentlyUsedMenus 是写入到注册表中的,还得把注册表中的值给清理掉,否则仅靠上面两行代码是无效的。在你的程序中搜索SetRegistryKey,复制该函数的字符串参数,去注册表中搜该字符串,清除掉该注册表项,再启动程序。 阅读全文

posted @ 2012-09-04 15:24 theEagles 阅读(357) 评论(0) 推荐(0)

摘要:释放顺序:视图 ---->子框架 ----> 文档 ---->主框架----> 应用程序Appvoid CGraphExView::PostNcDestroy()CGraphExView::~CGraphExView()CGraphFrame::~CGraphFrame()CGraphExDoc::~CGraphExDoc()CMainFrame::~CMainFrame()int CGraphExApp::ExitInstance()CGraphExApp::~CGraphExApp() 阅读全文

posted @ 2012-08-29 18:44 theEagles 阅读(266) 评论(0) 推荐(0)

摘要:截获MDI tab 的关闭按钮事件:重载ChildFrame的OnClose函数,在其中拦截关闭事件。例子:在其中判断是否是最后一个View,如果是最后一个,则关闭之前创建一个新的View,确保文档对象不被关闭。创建新View可以重载ChildFrame的OnWindowNew函数:OnWindowNewvoid CGraphFrame::OnWindowNew(){ CMainFrame* pMainFrame = (CMainFrame*) AfxGetMainWnd(); CDocument* pDoc=pMainFrame->MDIGetActive()->GetActi. 阅读全文

posted @ 2012-08-28 11:39 theEagles 阅读(192) 评论(0) 推荐(0)

摘要:Disable Close buttonvoid CChildFrame::OnSetFocus(CWnd* pOldWnd){ CMainFrame* pFrame= (CMainFrame*) AfxGetMainWnd(); //Get Handle to MainFrame CMDIChildWnd* pActiveChild = pFrame->MDIGetActive(); CView* pActivateView = pActiveChild->GetActiveView(); if ( pActiveChild != NULL ){ CDo... 阅读全文

posted @ 2012-08-28 11:32 theEagles 阅读(736) 评论(0) 推荐(0)

摘要:在VS2008中,有时候添加类的消息响应函数会弹出 “Add/remove operation is impossible, because the code element is readonly”解决方案是: 如果在这个出问题的类的头文件里定义了任何函数,把函数代码从头文件剪切到cpp文件里。关闭Visual Studio,删除ncb文件和suo文件。 打开工程,待Intellisesnce update完毕后,添加消息响应代码。 阅读全文

posted @ 2012-08-28 11:30 theEagles 阅读(257) 评论(0) 推荐(0)