Delphi:OpenFileDialog使用URL崩溃
时间:2020-03-06 14:43:51 来源:igfitidea点击:
给TOpenFileDialog一个URL,Execute方法抛出一个异常:
OpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult := OpenDialog1.Execute;
但是我们可以从URL打开文件。
德尔福5
解决方案
TOpenDialog只是comdlg32.dll中Windows函数GetOpenFileName的包装。
function TOpenDialog.Execute(ParentWnd: HWND): Boolean; begin Result := DoExecute(@GetOpenFileName, ParentWnd); end;
不幸的是,此功能的文档不是很好。但是我很确定它不支持http。