VC使用MSXML DOM的开发环境配置 (备忘,原文来自MSDN)
To install MSXML manually
注册msxml4.dll
Copy the DLLs to the system directory on your working machine.
Register the DLLs by typing the following at a command prompt:
Register the DLLs by typing the following at a command prompt:
cd c:\windows\system32
regsvr32 msxml4.dll
regsvr32 msxml4.dll
两种配置方式
There are two ways to instruct your application to use the DOM interfaces:
There are two ways to instruct your application to use the DOM interfaces:
第一种是自动的,最简单
1)To include headers and libraries automatically
Add the following two lines to your source code:
1)To include headers and libraries automatically
Add the following two lines to your source code:
#import <msxml4.dll> raw_interfaces_only
using namespace MSXML2;
using namespace MSXML2;
The raw_interfaces_only flag to #import directive suppresses the creation of "smart
pointer" C++ wrapper classes. In many cases, however, these wrappers are quite
useful and make working with CDO in C++ very simple.
raw_interfaces_only
该属性只允许展示类型库的低级内容。
第二种是手工的,复杂
2)To include headers and libraries manually
1. Locate the SDK directory installed by the appropriate MSXML package.
For example, your directory might be C:\msxml4\sdk, with subdirectories named inc and lib.
For example, your directory might be C:\msxml4\sdk, with subdirectories named inc and lib.
2. Add your directory to the standard include path.
To do this in Visual C++, open the Options... panel from the Tools menu. Click the Directories tab, then select Include files from the Show directories for drop-down menu. Add your directory name, such as "C:\msxml4\sdk\inc", to the Directories textbox.
To do this in Visual C++, open the Options... panel from the Tools menu. Click the Directories tab, then select Include files from the Show directories for drop-down menu. Add your directory name, such as "C:\msxml4\sdk\inc", to the Directories textbox.
这里说的是VC6.0
3. Add your directory to the system library path.
To do this in Visual C++, open the Options... panel from the Tools menu. Click the Directories tab. Select Library files from the Show directories for drop-down menu. Add your directory name to the Directories textbox.
4. Include the required MSXML header file by inserting the following macro into the source code:
To do this in Visual C++, open the Options... panel from the Tools menu. Click the Directories tab. Select Library files from the Show directories for drop-down menu. Add your directory name to the Directories textbox.
4. Include the required MSXML header file by inserting the following macro into the source code:
#include <msxml2.h>
5. Link msxml2.lib to your project.
To do this in Visual C++, open Project Settings by clicking Settings from the Project menu. Select the Link tab. Append "msxml2.lib" to the Object/library modules: textbox.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决