在Visual Studio 2015中实现MSXML [英] Implementation of MSXML in Visual Studio 2015

查看:180
本文介绍了在Visual Studio 2015中实现MSXML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在迁移2015年的Visual Studio项目VS.

I am migrating the 2008 Visual studio project in 2015 VS.

这些库包含在MSXML6中

The libraries are included for MSXML6

#include "Defines.h"
#import <MSXML6.dll> named_guids

#include <afxdlgs.h>
using namespace MSXML2;

命名空间用作:

	MSXML2::IXMLDOMDocument* pDocument = NULL;
	MSXML2::IXMLDOMParseError* pParseError = NULL;
	MSXML2::IXMLDOMElement* pElement = NULL;

我无法为基于MFC的项目加载XML文件。

I am unable to load the XML file for MFC based project.

对我来说,似乎我有XML解析的问题,问题似乎是MSXML在项目中的使用方式。是否对Visual Studio 2015进行了更改? 

For me it seems like i have problem with XML parsing and the issue seems to be the way MSXML is used in the project. Are there any changes to be made for Visual Studio 2015? 

推荐答案

您好Shiv_A_B,

Hi Shiv_A_B,

感谢您在此处发布。

>>对我来说,似乎我有XML解析的问题,问题似乎是MSXML在项目中的使用方式。是否对Visual Studio 2015进行了哪些更改?  

这是一份文档关于 MSXML 6.0中有什么新功能,但似乎与您的问题无关。

https://msdn.microsoft.com/en-us/library/ms753751(v=vs.85).aspx

因此,请提供有关如何加载xml文件的更多信息,并在加载失败时收到任何错误消息?

So please provide more information about how you load your xml file and have you got any error messages when you failed loading?

您可以按照以下代码使用MSXML 6.0加载xml文档。

You could follow these code below to load xml document with MSXML 6.0.

CoInitialize(NULL);   
MSXML2::IXMLDOMDocument2Ptr doc(L"MSXML2.DOMDocument.6.0");   
VARIANT_BOOL ok = doc->load(_variant_t(L"test.xml"));   
if (ok){   
    printf("test.xml is loaded");   
}   
doc.Release();   
doc = NULL;   
CoUninitialize();   

希望这可以帮到你。

最好的问候,

Sera Yu


这篇关于在Visual Studio 2015中实现MSXML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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