惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
F
Full Disclosure
Cloudbric
Cloudbric
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
N
News and Events Feed by Topic
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
GbyAI
GbyAI
C
Check Point Blog
B
Blog RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recorded Future
Recorded Future
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
T
The Blog of Author Tim Ferriss
O
OpenAI News
V
V2EX
人人都是产品经理
人人都是产品经理
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Security @ Cisco Blogs
C
Cisco Blogs
Security Latest
Security Latest
S
Security Affairs
V
Visual Studio Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
PCI Perspectives
PCI Perspectives
博客园_首页
U
Unit 42
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
L
LINUX DO - 热门话题
H
Hacker News: Front Page

博客园 - 今夜太冷

GPG(GnuPG)入门 Session variables lost after the call of Response.Redirect method c++中POD类型和non-POD类型 关于c++ template的branching和Recursion的一段很好的描述 How do I remove a particular element from an array in JavaScript? Get the client's IP address in socket.io 前端 使用 crypto-js 对数据进行对称加密 C++ delegate的几种方法 MFC更换窗口图标 boost::make_function_output_iterator报错: C4996 How to copy the contents of std::vector to c-style static array,safely? std::vector push_back报错Access violation Structured Exception Handling Catch a Memory Access Violation in C++ Windows上的字符转换之CP_ACP和CP_OEMCP Initialize a vector in C++ (5 different ways) MFC中使用ATL报错:error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C++ WINDOWS下 wchar_t *和char * 相互转化总结篇 VS2008 编译出错 fatal error C1859: unexpected precompiled header error, simply rerunning the compiler might fix this problem
解析XML出错,无法创建DOMDocument对象
今夜太冷 · 2018-08-11 · via 博客园 - 今夜太冷

【问题】

加载XML配置文件时,创建DOMDocument对象总是失败,创建代码如下:

MSXML2::IXMLDOMDocumentPtr pXMLDoc;

MSXML2::IXMLDOMElementPtr xmlRoot;

//创建DOMDocument对象

HRESULT hr = pXMLDoc.CreateInstance(__uuidof(MSXML2::DOMDocument40));

if(!SUCCEEDED(hr))

{

AfxMessageBox(_T("无法创建DOMDocument对象,请检查是否安装了MS XML Parser 运行库!"));

return ;

}

以前都没这问题,今天不知道怎么一直这样,求大神指点

【回答】

我以前也碰过这个问题,那是因为没有安装xmldom 40或者坏了.
可以试试xmldom 26, xmldom 30, xmldom 60, 不要写死就只能创建40

[注]仿照这个,我写了如下的代码,就成功了

     HRESULT HR = XMLDOC.CreateInstance(_uuidof(MSXML2::DOMDocument40));

     if(!SUCCEEDED(HR))

     {

        HR = XMLDOC.CreateInstance(_uuidof(MSXML2::DOMDocument60));

        if(!SUCCEEDED(HR))

        {

            HR = XMLDOC.CreateInstance(_uuidof(MSXML2::DOMDocument30));

            if(!SUCCEEDED(HR))

            {

                HR = XMLDOC.CreateInstance(_uuidof(MSXML2::DOMDocument26));

                if(!SUCCEEDED(HR))

                {

                    goto EXIT;

                }

            }

        }

     }