var
ht:Thttprio;
it1:Ifilews;
info:integer;
begin
try
ht:=THTTPRIO.Create(nil);
//it1:=getIfilews(true,'',ht);
it1:=getifilews; ===================>如果是线程,这里会出错
info:=it1.isfileExists('e:\12.txt');
if info=0 then
begin
self.Caption :='文件存在';
end
else
begin
self.Caption:='文件不存在';
end;
finally
ht.Free;
end;
end;
//就以上这段代码,
//在主界面ok,线程中这些代码就出现Abstract Error的错误
//怎么找都找不到原因,到底为什么?
ht:Thttprio;
it1:Ifilews;
info:integer;
begin
try
ht:=THTTPRIO.Create(nil);
//it1:=getIfilews(true,'',ht);
it1:=getifilews; ===================>如果是线程,这里会出错
info:=it1.isfileExists('e:\12.txt');
if info=0 then
begin
self.Caption :='文件存在';
end
else
begin
self.Caption:='文件不存在';
end;
finally
ht.Free;
end;
end;
//就以上这段代码,
//在主界面ok,线程中这些代码就出现Abstract Error的错误
//怎么找都找不到原因,到底为什么?
如果解释不清,就扣你10000分.
解释好了老冯给你一颗LOLLIPOP.
getifilews里面是什么??
另: 线程里面就没有caption了
//线程开始
CoInitialize(nil);
try
...//创建RIO
...//调用finally
CoUnInitialize;
end;
在Create和Destory里我做了CoInitialize(nil); CoUnInitialize;
====
GetIfilews是获得接口的方法,由WSDL import 生成。
====
现在错误如下:
//在主界面ok,线程中这些代码就出现Abstract Error的错误网络上查是说将接口实例化,但是我不知道该怎么改正这个错误。
各位达人能不能给个更清晰的说法啊?
另
GetIfilews是获得接口的方法,由WSDL import 生成 不是很明白
GetIfilews 没有问题。是我的问题。这样才ok
CoInitialize(nil);
try
ht:=THTTPRIO.Create(nil);
ht.URL:='http://../webservicetest/Filews.dll/soap/ifilews';
ht.WSDLLocation:='http://../webservicetest/Filews.dll/wsdl/ifilews';
ht.Service:='Ifilewsservic'
ht.Port:='ifilewsPort';
it1:=ht as Ifilews;
it1.xxx(...)
finally
CoUnInitialize;
end;
归根到底还是自己对WebService传输过程不了解。谢谢大家关注。