包含< afxtoolbar.h>时出错进入stdafx.h [英] Error when including <afxtoolbar.h> into stdafx.h

查看:247
本文介绍了包含< afxtoolbar.h>时出错进入stdafx.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用旧的C ++应用程序,我想用CMFCToolBar类替换它使用的CToolBar类。



每当我包含"afxtoolbar.h"时我需要CMFCToolbar到我的StdAfx.h头文件中,我得到随机错误。我得到的错误是:\窗口套件\8.1 \include \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


文件应该与我的包含无关。有没有人知道我可以尝试做什么?



我没有使用MFC的经验,但我确实包含了"stdafx.h"。在包括afxtoolbar.h之前。



我正在使用Microsoft VS15,重新安装它,同样的事情再次发生。我真的很感激任何形式的输入。


Down我发布了我的StdAfx.h标题,没有包含"afxtoolbar.h"。只要我在此标题中的任何位置包含该内容,我就会收到上述错误。

我还将此信息发布到Stackoverflow,并认为如果我在此处发布它也会有更多人看到它。 



 // StdAfx.h 

#if!defined(AFX_STDAFX_H__27E0350C_582E_11D1_A6E5_444553540000__INCLUDED_)
#define AFX_STDAFX_H__27E0350C_582E_11D1_A6E5_444553540000__INCLUDED_

#if _MSC_VER> = 1000
#pragma一次
#endif // _MSC_VER> = 1000

#define VC_EXTRALEAN //很少排除 - 来自Windows头文件的东西
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE
#include< afxwin.h> // MFC核心和标准组件
#include< afxext.h> // MFC扩展名
#include< afxole.h> // MFC OLE类
#include< afxodlgs.h> // MFC OLE对话框类
#include< afxdisp.h> // MFC OLE自动化类
#include< afxdocob.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include< afxcmn.h> // MFC对Windows公共控件的支持
#endif // _AFX_NO_AFXCMN_SUPPORT
#include< afxtempl.h> // MFC模板

#include" .. \ Common \ Common.h"

// {{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio将在前一行之前插入其他声明。

#endif





解决方案

朋友,


您的问题与C ++有关,我将转到相应的论坛,以获得专业的答案。



祝你好运,


Fletch


I am working on an old C++ application and I would like to replace the CToolBar class that it uses with the CMFCToolBar class.

Whenever I include "afxtoolbar.h" which I need for CMFCToolbar into my StdAfx.h header file, I get random errors. The errors I get are: \windows kits\8.1\include\um\gdipluscolor.h(229): error C2059: syntax error: constant and C3805 in the same file.

The file should be unrelated to my include. Does anybody have an idea about what I can try to do?

I am not experienced in using MFC, but I did include "stdafx.h" before including afxtoolbar.h.

I am using Microsoft VS15, have reinstalled it and the same thing happens again. I would be really grateful for input of any kind.
Down I posted my StdAfx.h header, without the include of "afxtoolbar.h". As soon as I include that anywhere in this header, I get the aforementioned errors.
I have also posted this to Stackoverflow and thought that more people might see it if I posted it here as well. 

//StdAfx.h

#if !defined(AFX_STDAFX_H__27E0350C_582E_11D1_A6E5_444553540000__INCLUDED_)
#define AFX_STDAFX_H__27E0350C_582E_11D1_A6E5_444553540000__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
#define _CRT_SECURE_NO_WARNINGS 
#define _CRT_SECURE_NO_DEPRECATE
#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxole.h>         // MFC OLE classes
#include <afxodlgs.h>       // MFC OLE dialog classes
#include <afxdisp.h>        // MFC OLE automation classes
#include <afxdocob.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>         // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxtempl.h>       // MFC templates

#include "..\Common\Common.h" 

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif 


解决方案

Hi friend,

Your issue is more related to C++, I will move to corresponding forum for you to get a professional answer.

Best regards,

Fletch


这篇关于包含&lt; afxtoolbar.h&gt;时出错进入stdafx.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆