与 IXMLDOMNode* 相关的 C++ 错误

标签 c++ com mfc

我在编译我们的遗留 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_)

最佳答案

您应该显示更多上下文。也许你应该有资格

MSXML::IXMLDOMDocument

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

关于与 IXMLDOMNode* 相关的 C++ 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5653971/

相关文章:

c# - 从 .NET 附加到 COM 服务器中的事件时出现 E_ACCESSDENIED 异常

c++ - UpdateLayeredWindow、SIZE_RESTORED 和 GetClientRect 问题

c++ - 不稳定的单例成员?

c++ - 从线程运行函数时如何返回值

c++ - 从 MSVC 19.29 (VS16.11) 开始,条件运算符表达式出现问题 C2445

c++ - MFC 自定义按钮控件

c++ - 消息映射的解释

c++ - 计算 C 中 NSDate 之间的秒数

C# 应用程序在调用 COM 类的方法时崩溃

delphi - Delphi有 "getopt"的实现吗?