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;

posted @ 2012-05-11 11:07  ☆会飞的鱼☆  阅读(660)  评论(0编辑  收藏  举报