Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

A question about Win32::OLE. Really need you help!!!
A question about Win32::OLE. Really need you help!!!


There is a standalone executable written in C/C++.
What I am going to do is to write a perl script to call several
functions available in this executable.


From the following article, I thought the job is very easy.
=09#10 - Win32::OLE by Jan Dubois
=09The Perl Journal #10 - Win32::OLE by Jan Dubois
Just considering the executable as an OLE server, and the PERL script
as an OLE controller should be OK.


When I call the functions, most of them work well, for example:

=09my $app =3D Win32::OLE->new('AAA.BBB', 'Quit');

=09# call the function:
=09#=09BOOL GetPathname(BSTR* Pathname)

=09my $Pathname =3D Variant(VT_BSTR|VT_BYREF, '');
=09my $ret =3D $app->GetPathname($Pathname);


But, for the following function, I don't know that I should pass to
this funtion.
Array reference or something else?

=09# BOOL GetValues(BSTR* names, double* values, short number_of_names);

=09# (input)
=09#=09names: a list of names
=09#=09number_of_names: size of the array
=09# (output)
=09#=09values: a list of corresponding values,


I tried to pass array references to it, and something else, like the follow=
ing,
both failed with an error: Type Mismatch...

=09my $names =3D Variant(VT_BSTR|VT_ARRAY, 3);
=09my $values =3D Variant(VT_R8|VT_ARRAY, 3);

=09$names->Put( ['name1', 'name2', 'name3'] );
=09$values->Put( [0, 0, 0] )

=09my $ret =3D GetValues($names, $values, 3);


Do you guys have and idea about that?
What shold I pass to this function?
Is there any other way to do the same thing?

Any comments are appreciated.


BTW:
I know that if the OLE controller is in C language, things will be easier,
Pass the first element of the array to this function should be OK.

Report this thread to moderator Post Follow-up to this message
Old Post
J aperlh
06-06-05 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:40 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.