您的位置:首页 > Web前端

VS2008中关于将旧VC方案修改为最新的MFC Feature Pack最需要注意的问题

2008-09-05 10:30 393 查看
网上“用VS2008 Feature Pack 修改您现有的Visual C++的程序界面”有很多,在用以下在CMainFrame::OnCreate()函数的最后部分,添加代码设定当前界面的风格:
      CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007));
      CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007Luna_Blue);
系统将会出现“Cannot load Style”错误!
      调试了很长时间,才找出原因:
    
4 #if !defined _AFXDLL
5 TRACE(_T("/r/nImportant: to enable the Office 2007 look in static
link,/r/n"));
6 TRACE(_T("include afxribbon.rc from the RC file in your
project./r/n/r/n"));
7 ASSERT(FALSE);
8 #endif

 
需要在方案的RC文件中include afxribbon.rc资源。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mfc include office class file c