ShellExecute() terminates the program execution

Post Reply
User avatar
Euclides
Posts: 144
Joined: Wed Mar 28, 2007 1:19 pm

ShellExecute() terminates the program execution

Post 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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Have you tried winexec("test.exe")?

Regard
Otto
User avatar
Euclides
Posts: 144
Joined: Wed Mar 28, 2007 1:19 pm

Post 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
User avatar
Euclides
Posts: 144
Joined: Wed Mar 28, 2007 1:19 pm

Post 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
Post Reply