如何调用指定的外部程序打开指定的文件!

bbu 2003-08-20 02:47:07
我同时装了好几个版本的Cad,想选择特定的版本打开指定的文件。怎么实现?
...全文
57 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lvjack 2003-08-20
  • 打赏
  • 举报
回复
建议使用ShellExecute
ShellExecute(Application->Handle,null,"path\\autocad.exe","yourfilename",NULL,SW_SHOWNORMAL)

HINSTANCE ShellExecute(

HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);
bcb_alone 2003-08-20
  • 打赏
  • 举报
回复
楼上对,也可用
ShellExecute函数。
xuv2002 2003-08-20
  • 打赏
  • 举报
回复
WinExec("d:\\xx.exe d:\\xxx.cad",SW_SHOW);
使用可执行程序+指定文件的全路径就可以达到目的
jintaocom 2003-08-20
  • 打赏
  • 举报
回复
外部程序提供接口?

13,824

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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