我在编译我们的遗留 COM 组件之一时遇到问题。我收到以下编译器错误:
error C2501: 'IXMLDOMNode' : missing storage-class or type specifiers
error C2061: syntax error : identifier 'IXMLDOMNode'
在 .h 文件中的这一行代码:
IXMLDOMNode* CreateChildNodeOfItem(IXMLDOMNode* pNode, DOMNodeType nodeType, CString strName);
我假设 IXMLDOMNode 来自这个库:
#include <msxml.h>
我需要安装缺少的 SDK 吗?
编辑:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__84FB3EAC_AE73_4076_9DF6_E48B18DA7098__INCLUDED_)
#define AFX_STDAFX_H__84FB3EAC_AE73_4076_9DF6_E48B18DA7098__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <atlbase.h>
#include <msxml.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__84FB3EAC_AE73_4076_9DF6_E48B18DA7098__INCLUDED_)
最佳答案
关于与 IXMLDOMNode* 相关的 C++ 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5653971/