ShellExecute

M

magix

Dear Guru,

From Dos Command, I can execute like C:\Converter TextFile.txt or
C:\Converter D:\TextFile.txt

I wrote an application (using VC++) to call a dos command, where
sztxtBuffer1 is the select / browse text file, and Converter.exe is located
at the same directory/ folder with this application.
I tested that the following is not working well.
int ret = (int)ShellExecute(hWnd, "open", "Converter.exe", sztxtBuffer1 ,
NULL, 0);

How can the application look for Converter.exe at the current direcotry,
instead of specifying the absolute path of Converter like

int ret = (int)ShellExecute(hWnd, "open", "C:\Converter.exe",
sztxtBuffer1 , NULL, 0);


Because the application and converter can be installed at any directory.

Thanks.
 
V

Victor Bazarov

magix said:
Dear Guru,

From Dos Command, I can execute like C:\Converter TextFile.txt or
C:\Converter D:\TextFile.txt

I wrote an application (using VC++) to call a dos command, where
sztxtBuffer1 is the select / browse text file, and Converter.exe is
located at the same directory/ folder with this application.
I tested that the following is not working well.
int ret = (int)ShellExecute(hWnd, "open", "Converter.exe",
sztxtBuffer1 , NULL, 0);

How can the application look for Converter.exe at the current
direcotry, instead of specifying the absolute path of Converter like

int ret = (int)ShellExecute(hWnd, "open", "C:\Converter.exe",
sztxtBuffer1 , NULL, 0);


Because the application and converter can be installed at any
directory.

Your question doesn't belong here. You need to post your OS-specific
question to 'comp.os.ms-windows.programmer' (or any of its subgroups).

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top