我在编译我们的一个遗留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_)发布于 2011-04-13 20:06:24
我改变了包含msxml的方式,它似乎修复了编译器错误。我改变了:
#include <msxml.h>至
#import <msxml.dll> raw_interfaces_only
using namespace MSXML; 发布于 2011-04-13 18:46:36
你应该展示更多的背景。也许你应该有资格
MSXML::IXMLDOMDocument另请参阅:平台不兼容的http://support.microsoft.com/kb/301939
https://stackoverflow.com/questions/5653971
复制相似问题