佚名通过本文主要向大家介绍了soaptoolkit,com口驱动程序下载,com 应用程序和组件,com 应用程序,com程序等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 一个COM小程序,用SoapToolKit连服务器,连接上了就崩溃错在哪里?
描述:
运行,卡在Connect()那儿,然后弹出红色的叉叉框显示:
Debug Error!
Program.....
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
解决方案1:
我是在08,xp3下测试的 解决方案3:
描述:
我写了个小程序链接一个soap的服务器,#import了微软的SoapToolKit提供的COM DLL。代码如下:
// testsoap.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
#include<windows.h>
#pragma warning(disable:4192)
#import "C:\Program Files\Common Files\MSSoap\Binaries\MSSOAP1.dll" \
exclude("IStream","ISequentialStream","_LARGE_INTEGER", \
"_ULARGE_INTERGER","tagSTATSTG","_FILETIME")
using namespace MSSOAPLib;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);
ISoapConnectorPtr Connector;
Connector.CreateInstance(__uuidof(HttpConnector));
Connector->Property["EndPointURL"]="http://www.allesta.net:51110/webservices/soapx4/isuseronline.php";
Connector->Connect();
Connector->Property["SoapAction"]="uri:allesta-YahooUserPing";
Connector->BeginMessage();
ISoapSerializerPtr Serializer;
Serializer.CreateInstance(__uuidof(SoapSerializer));
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));
Serializer->startEnvelope("","","");
Serializer->startBody("");
Serializer->startElement("isuseronline","uri:allesta-YahooUserPing","","m");
Serializer->startElement("username","","","");
Serializer->writeString("laghari78");
Serializer->endElement();
Serializer->endElement();
Serializer->endBody();
Serializer->endEnvelope();
Connector->EndMessage();
ISoapReaderPtr Reader;
Reader.CreateInstance(__uuidof(SoapReader));
/*Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "");
_bstr_t bVal;
Reader->RPCResult->get_text(bVal.GetAddress());
printf("Answer: %s\n", (const char *)_com_util::ConvertBSTRToString(bVal));*/
CoUninitialize();
return 0;
}
运行,卡在Connect()那儿,然后弹出红色的叉叉框显示:
Debug Error!
Program.....
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
解决方案1:
try catch 看看
解决方案2:我是在08,xp3下测试的 解决方案3:
而且没作任何设置。。要说不同,就是int main(int argc, TCHAR* argv[])这里不同
解决方案4:我用了你的代码测试了一下,居然都没出问题。。。
解决方案5:应该是 EndPointURL里面填的那个地址有误了