Page 1 of 1

ShellExecute() terminates the program execution

Posted: Thu Sep 27, 2007 12:51 pm
by Euclides
Hi to all!
To call external programs (MSWord, Excel, Notepad, etc) in Windows XP,
I use ShellExecute() with no problems during the past years.
Lately in some machines, the FiveWin program just terminates in a ShellExecute() command line, with no error indications or logs at all.
If I reinstall the Windows XP, the problem disapears.
The customer gets very puzzled because only the FiveWin programs are affected.
In all cases, calling MSWord or Excel by OLE works normally.
Thanks in advance for sugestions.
Regards, Euclies

Posted: Thu Sep 27, 2007 5:34 pm
by Otto
Have you tried winexec("test.exe")?

Regard
Otto

Posted: Fri Sep 28, 2007 1:25 pm
by Euclides
Yes Otto, you are right!
I stopped using all the waitrun & winexec some years before when started using ShellExecute in the Windows XP.
I changed all my ShellExec calls to winexec it works fine on my computer.
I am going to test it on the customerĀ“s site.
Thanks
Euclides

Posted: Thu Oct 04, 2007 2:28 pm
by Euclides
Hi to all,
Just to finish the post...
The WinExec worked in all XP machines who aborted the FiveWin program in the ShellExecute calls.
I had to do some strange things like:
WinExec("cmd /c start \"+GetCurDir()+"\mergeout.rtf")
but anyway... I di not reinstall the Windows again.
Regards, Euclides