I started using the Winexec() function. It seems to work fine if you have only 1 parameter to pass but not for more than 1 parameter.
I am using it to run Open Office.
Winexec( ""ooffice", "Test1.rep" )
works but the following don't
Winexec( "ooffice", "-writer", "Test1.rep" )
Winexec( "ooffice", "Test1.rep", "Test2.rep" )
neither does
Winexec( "ooffice", "-writer Test1.rep" )
Winexec( "ooffice", "Test1.rep Test2.rep" )
But the following commands issued from a terminal window all work:
ooffice -writer Test1.rep
ooffice Test1.rep Test2.rep
It's no real issue at the moment as I can easily code around the apparent limitation for what I am needing to do at the moment, but maybe you can look at it one day and see if I am correct and fix. I inferred from the documentation that the function is intended to handle multiple parameters being passed. Then again maybe I have misunderstood the documentation and am coding incorrectly.
(Test1.rep and Test2.rep are just Open Office writer documents - the ones I am using are in OO html format and are being generated by my software.)
Thanks
Doug
(xProgrammer)
Winexec() function
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Winexec() function
The documentation clearly states:
EMG
As you can see, the first parameter is the command line, parameters included. The second parameter is the show mode. The function expects only two parameters.WinExec( <nCmdLine>, <nCmdShow> ) --> <hInstance>
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: