Page 1 of 1

Winexec() function

Posted: Mon Dec 17, 2007 6:19 am
by xProgrammer
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)

Re: Winexec() function

Posted: Mon Dec 17, 2007 9:14 am
by Enrico Maria Giordano
The documentation clearly states:
WinExec( <nCmdLine>, <nCmdShow> ) --> <hInstance>
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.

EMG

Posted: Mon Dec 17, 2007 10:00 am
by Antonio Linares
Enrico,

FiveLinux WinExec() is inspired in Windows one, but it works a little different.

Doug,

You are right, actually we are only accepting one parameter. We need to modify it to accept an unlimited number of parameters. We are going to review it

Posted: Mon Dec 17, 2007 10:38 am
by Enrico Maria Giordano
Antonio Linares wrote:Enrico,

FiveLinux WinExec() is inspired in Windows one, but it works a little different.
Ops, I was not aware that this is a forum for FiveLinux, sorry.

EMG

Posted: Mon Dec 17, 2007 11:06 am
by Antonio Linares
No problem, my friend :-)