开发者

Open file with another application

开发者 https://www.devze.com 2023-02-13 04:37 出处:网络
Hy! I want to open an .xml file from c++ with a specified application (knowing the path of the file and the path of the application). Same way as you would right-click the file and click \"Open with.

Hy!

I want to open an .xml file from c++ with a specified application (knowing the path of the file and the path of the application). Same way as you would right-click the file and click "Open with..." and cho开发者_运维问答ose the application to start with.

Thanks in advance!


Usually applications allow command line arguments for file opening. For example, to open a file with notepad you can use command line :

notepad.exe a.txt

That's why you can use this feature with CreateProcess in Windows (which allows specifying arguments) or analogous function in other OS . HTH


how about simply:

system("application.exe file.xml");
0

精彩评论

暂无评论...
验证码 换一张
取 消