首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与IXMLDOMNode相关的C++错误*

与IXMLDOMNode相关的C++错误*
EN

Stack Overflow用户
提问于 2011-04-13 18:42:35
回答 2查看 1.8K关注 0票数 0

我在编译我们的一个遗留COM组件时遇到困难。我得到以下编译器错误:

代码语言:javascript
复制
error C2501: 'IXMLDOMNode' : missing storage-class or type specifiers
error C2061: syntax error : identifier 'IXMLDOMNode'

在.h文件中的这一行代码上:

代码语言:javascript
复制
IXMLDOMNode* CreateChildNodeOfItem(IXMLDOMNode* pNode, DOMNodeType nodeType, CString strName);

我以为IXMLDOMNode是从这个图书馆来的:

代码语言:javascript
复制
#include <msxml.h>

我需要安装缺少的SDK吗?

编辑:

代码语言:javascript
复制
// 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_)
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-04-13 20:06:24

我改变了包含msxml的方式,它似乎修复了编译器错误。我改变了:

代码语言:javascript
复制
#include <msxml.h>

代码语言:javascript
复制
#import <msxml.dll> raw_interfaces_only
using namespace MSXML; 
票数 1
EN

Stack Overflow用户

发布于 2011-04-13 18:46:36

你应该展示更多的背景。也许你应该有资格

代码语言:javascript
复制
MSXML::IXMLDOMDocument

另请参阅:平台不兼容的http://support.microsoft.com/kb/301939

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5653971

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档