如果谁能解决,这120分都归他!

AirLu 2004-05-11 09:19:14
在普通应用程序中这样写是正确的URLDownLoadToFile(nil, PChar('http://xxx/a.zip), PChar('c:\a.zip'), 0, nil),但如果在编写activex控件中使用此函数时,第一个参数不能用nil(也不能用0),不知那位高手知道该怎么写。

以下是URLDownLoadToFile函数的参数说明:
Syntax

HRESULT URLDownloadToFile(
LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);

Parameters

pCaller:
Pointer to the controlling IUnknown interface of the calling Microsoft® ActiveX® component (if the caller is an ActiveX component). If the calling application is not an ActiveX component, this value can be set to NULL. Otherwise, the caller is a Component Object Model (COM) object that is contained in another component (such as an ActiveX control within the context of an HTML page). This parameter represents the outermost IUnknown of the calling component. The function attempts the download within the context of the ActiveX client framework and allows the caller's container to receive callbacks on the progress of the download.

szURL:
Pointer to a string value containing the URL to be downloaded. Cannot be set to NULL.

szFileName:
Pointer to a string value containing the name of the file to create for bits that come from the download.

dwReserved:
Reserved. Must be set to 0.

lpfnCB:
Pointer to the caller's IBindStatusCallback interface.

其中第一个参数pCaller到底该怎么写?
请高手不吝赐教!

如果谁能解决另外100分也归他:
http://expert.csdn.net/Expert/topic/3044/3044742.xml?temp=.9874231
...全文
85 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaocuo_zrf 2004-06-08
  • 打赏
  • 举报
回复
怎么名字像 aiirii(ari-爱的眼睛) 的马夹啊!!
豆豆浆爸爸 2004-06-08
  • 打赏
  • 举报
回复
你把nil改为null
aiirii 2004-05-14
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
var p1: IUnknown;
p2,p3: PAnsiChar;
p4: DWORD;
p5: IBindStatusCallback;
begin
p1 : = nil;
p2 : = PCHAR('http://domain/directory/targetfile');
p3 : = PCHAR('test.bmp');
p4 : = 0;
p5 : = nil;
URLDownLoadToFile(p1,p2,p3,p4,p5);
end;
halfdream 2004-05-14
  • 打赏
  • 举报
回复
VCL在TComponent就提供了一个GetComObject的方法。

在适当的地方用它,可以在ACTIVEX内取到这个IUnknown接口
Heyongfeng 2004-05-14
  • 打赏
  • 举报
回复
zousoft 2004-05-13
  • 打赏
  • 举报
回复
不知道, 帮你顶.
null行吗? IUnknown行吗? 我瞎说, 别理我...
qizhanfeng 2004-05-13
  • 打赏
  • 举报
回复
up
AirLu 2004-05-13
  • 打赏
  • 举报
回复
难道就没人会吗?
AirLu 2004-05-11
  • 打赏
  • 举报
回复
怎么样才可以获得ActiveX的Unknown接口,具体该怎么写,请赐教!
风中的猴尾巴 2004-05-11
  • 打赏
  • 举报
回复
这个贴才20分
UrlMon.UrlDownLoadToFile(p1:ActiveX的Unknown接口;p2:pchar 文件的URL;
p3:pchar 保存路径及文件名;p4:dword 必须 为0;p5:IBindStatusCallback )

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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