刚开始接触xml 想用VS2008 读取 帮助文件中的基本例子 但是第一步创建com 接口就出错了 之前没接触过com编程 麻烦懂得帮忙看一下 多谢 
用的是msxml6 相应的sdk也安装了 用命令行regsvr32 msxml6.dll成功 
源代码
#include <stdio.h>
#include <msxml6.h>
//int _tmain(int argc, _TCHAR* argv[]) // VC.NET
int main(int argc, char* argv[])
{
   HRESULT hr;
   IXMLDOMDocument2 *pXMLDoc = NULL;
   IXMLDOMParseError * pObjError = NULL;
   BSTR bstr = NULL;
   VARIANT_BOOL status;
   VARIANT vSrc;
// 创建XML的DOM2之COM对象
   CoInitialize(NULL); // 初始化COM库
// 创建指定类的一个未初始化对象,获取对应接口的指针
   hr = CoCreateInstance(CLSID_DOMDocument40,  // 类标识
            NULL,  // 是否外部集合之部分的指针
            CLSCTX_INPROC_SERVER,  // 可执行代码内容(DLL)
            IID_IXMLDOMDocument2, // 接口标识的引用
            (void**)&pXMLDoc); // 接受指定接口指针的外部变量
   if (FAILED(hr)) { // 创建失败
      printf("Failed to CoCreate an instance of an XML DOM\n");
      printf("Error code: %x\n", hr);
      goto clean;
   }

CoCreateInstance 这个执行错误 错误代码是80040154 好像是什么注册失败啥的不懂 麻烦 说一下解决办法