admin管理员组

文章数量:1530278

问题已经解决,今天有点发癫了。

 

原因如下,是因为在创建工程的时候,把下面这个勾没有带:

 

 

如果要在现在已经存在的工程上面修改的话,需要使用到比较工具合入下面的代码,解决方法如下:

 

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 libraries
	if (!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 经典的:

本文标签: 两种界面解决方案方式经典