InstallShield高级应用打开文件对话框

打开文件对话框,若异常则打开文件夹对话框。

实现方法如下


export prototype number OpenFileDialog(byref string);

//Open File Dialog User Com object "UserAccounts.CommonDialog"
function OpenFileDialog(szFileFullPath)
OBJECT ObjDialog;
begin
try
set ObjDialog = CreateObject("UserAccounts.CommonDialog") ;
ObjDialog.Filter = "Access File(*.mdb)|*.mdb";//|All Files(*.*)|*.*" ;
//ObjDialog.FilterIndex = 1;
//ObjDialog.InitialDir = "c:\\";
//Open File Dialog
if ObjDialog.ShowOpen() then
szFileFullPath = ObjDialog.FileName;
endif;
catch
set ObjDialog = NOTHING;
return -1;
endcatch;

set ObjDialog = NOTHING;
return 0;
end;

作者:chhuic

出处:http://chhuic.cnblogs.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

原文地址:https://www.cnblogs.com/chhuic/p/2495611.html