兩種介面,求助,如何去掉經典顯示,我只要windows 7方式的,謝謝(附解決方案)

來源:互聯網
上載者:User

問題已經解決,今天有點發癲了。

 

原因如下,是因為在建立工程的時候,把下面這個勾沒有帶:

 

 

如果要在現在已經存在的工程上面修改的話,需要使用到比較工具合入下面的代碼,解決方案如下:

 

1、在類Cxxxapp比如CMFCApplication1App的初始化函數InitInstance()裡面添加如下東西

 

在CWinAppEx::InitInstance();之前寫入:

// 如果一個運行在 Windows XP 上的應用程式資訊清單指定要// 使用 ComCtl32.dll 版本 6 或更高版本來啟用可視化方式,//則需要 InitCommonControlsEx()。否則,將無法建立視窗。INITCOMMONCONTROLSEX InitCtrls;InitCtrls.dwSize = sizeof(InitCtrls);// 將它設定為包括所有要在應用程式中使用的// 公用控制項類。InitCtrls.dwICC = ICC_WIN95_CLASSES;InitCommonControlsEx(&InitCtrls);

然後在:

CWinAppEx::InitInstance();// Initialize OLE librariesif (!AfxOleInit()){AfxMessageBox(IDP_OLE_INIT_FAILED);return FALSE;}

之後,補上這句:

AfxEnableControlContainer();

 

2、修改標頭檔:stdafx.h,添加這一段:

#include <afxdisp.h>        // MFC 自動化類
#ifdef _UNICODE#if defined _M_IX86#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")#elif defined _M_X64#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")#else#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")#endif#endif

直接搞定!

 

問題描述如下:

windows 7的:

windows 經典的:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.