TWebBrowser中execWB异常

lanshizi 2005-09-18 08:03:45
使用TWebBrowser组件方法execWB
当execWB出现异常怎么处理
象这样:
try
webbrowser1.ExecWB(olecmdid_saveas,olecmdexecopt_dontpromptuser);
except
exit;
end;
弹出另存的对话框,点取消就会出现异常,怎么办?
...全文
80 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
蒋晟 2005-09-19
  • 打赏
  • 举报
回复
The WebBrowser control and Internet Explorer have Save and Save As options that can be used to save files using the ExecWB command. However, this involves prompting from the user. There is no way to suppress this prompt. To save files to the hard-disk without prompting, use the URLDownloadToFile API from URLMON.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q244757&ID=KB;EN-US;q244757&

BTW, you omited 2 OleVariant parameterts. try to pass empty OleVariants instead of omit them.

var
Vin, Vout : OleVariant;
begin
Vin := '';
Vout := '';
EmbeddedWB1.ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DODEFAULT,
Vin, Vout);

end;

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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