|
Posted by sachin on July 31, 2007, 1:09 am
Please log in for more thread options
>
> .
> .
>
>
>
>
>
> > Following is the code I have written,
> > ***********************************************************************=
****=AD*****************
> > use Win32::Process;
> > use Win32;
>
> > $GPIBPath =3D "C:\Project\GPIB\GPIB.V2\bin\GPIB.exe";
> > @GPIBArg =3D ("5","3.2","10","2","1");
>
> > Win32::Process::Create($GPIBObj,
> > $GPIBPath,
> > @GPIBArg,
> > 0,
> > NORMAL_PRIORITY_CLASS,
> > ".") || die ErrorReport();
>
> > $GPIBObj->Wait(INFINITE);
>
> > sub ErrorReport{
> > print Win32::FormatMessage( Win32::GetLastError() );
> > }
> > ***********************************************************************=
****=AD*******************
> > When I execute this pl file using command prompt, i get the following
> > error
> > Usage: Win32::Process::Create(cP , appname , cmdline , inherit ,
> > flags , curdir) at file_handling.pl line 7
>
> When you get a "Usage: ..." error, that generally means there is something
> wrong with the arguments you supplied.
> In this case it's the third argument (@GPIBArg) that's the problem.
> I think that replacing that third arg to Win32::Process::Create() with
> either:
> "GPIB @GPIBArg",
> or
> "$GPIBPath @GPIBArg",
> or
> "GPIB 5 3.2 10 2 1",
> or
> "$GPIBPath 5 3.2 10 2 1",
> should work.
>
> See the example given at the start of 'perldoc Win32::Process'. Note that
> the 3rd arg needs to be the actual command line command that you want to
> run.
> It's one of the strange quirks of Win32::Process that the 3rd arg needs to
> repeat something that can be derived from the 2nd arg.
>
> Cheers,
> Rob- Hide quoted text -
>
> - Show quoted text -
Thanks for your advice.
I have used the following parameter sequence.
$GPIBPath =3D "5 3.2 10 2 1";
And it is running fine.
|