Winexec() function

Post Reply
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Winexec() function

Post 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)
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Winexec() function

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

No problem, my friend :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply