那位大侠做过VC与XML相结合的东东,有没有例子或相关的书?

cmhtx 2002-09-01 01:18:41
详细一点的,关于Dom和Sax的!
...全文
37 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cmhtx 2002-09-01
  • 打赏
  • 举报
回复
我 Load了一个XML文件,结果链接时出现如下错误,这是为什么?请指教!!

SegIDEView.obj : error LNK2001: unresolved external symbol _IID_IXMLDOMNode
SegIDEView.obj : error LNK2001: unresolved external symbol _CLSID_DOMDocument2
SegIDEView.obj : error LNK2001: unresolved external symbol _IID_IXMLDOMDocument
Debug/SegIDE.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
masterz 2002-09-01
  • 打赏
  • 举报
回复
// testxml.cpp : Defines the entry point for the console application.
//

#import "msxml.dll"
#import "msxml2.dll"

using namespace MSXML2;
int main(int argc, char* argv[])
{
printf("Test of XMLHTTP by masterz!\n");
CoInitialize(NULL);
try
{
IXMLHTTPRequestPtr xmlrequest;
xmlrequest.CreateInstance("Msxml2.XMLHTTP");
_variant_t varp(false);
xmlrequest->open(_bstr_t("GET"),_bstr_t("http://www.csdn.net/expert/topic/855/855052.xml?temp=.176037"),varp);
xmlrequest->send();
BSTR bstrbody;
xmlrequest->get_responseText(&bstrbody);
_bstr_t bstrtbody(bstrbody);
printf("%s\n",(LPCTSTR)bstrtbody);

}
catch (_com_error &e)
{
printf("Description = '%s'\n", (char*) e.Description());
}
CoUninitialize();
printf("program end\n");
return 0;
}


///////Post with XMLHTTP///////////////////////
#import "msxml.dll"
#import "msxml2.dll"
#include "Atlbase.h"
using namespace MSXML2;
int main(int argc, char* argv[])
{
printf("Test of XMLHTTP by masterz!\n");
CoInitialize(NULL);
try
{
IXMLHTTPRequestPtr xmlrequest;
//xmlrequest.CreateInstance("Msxml2.XMLHTTP");
xmlrequest.CreateInstance(__uuidof(XMLHTTP));
CComVariant vFalse(FALSE);
CComVariant vNull(NULL);
xmlrequest->open("POST",
_bstr_t("http://211.157.102.21/member/logon.asp"),vFalse,vNull,vNull);
xmlrequest->setRequestHeader("Content-Type:","application/x-www-form-urlencoded");
_bstr_t bsdata("name=xxx&pass=xxx&type=1");//use your login name and password
xmlrequest->send(_variant_t(bsdata));

BSTR bstrbody;
xmlrequest->get_responseText(&bstrbody);
_bstr_t bstrtbody(bstrbody);
printf("%s\n",(LPCTSTR)bstrtbody);
//MessageBox(0,bstrtbody,"",MB_OK);

}
catch (_com_error &e)
{
printf("Description = '%s'\n", (char*) e.Description());
}
CoUninitialize();
printf("program end\n");
return 0;
}
masterz 2002-09-01
  • 打赏
  • 举报
回复
http://www.codeproject.com/soap/
SOAP and XML topics
Lostinet 2002-09-01
  • 打赏
  • 举报
回复
。。只做过一次。为了实现JSCRIPT的5行代码。
花掉我20行的C++代码。。~~~

3,055

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC HTML/XML
社区管理员
  • HTML/XML社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧