Win32::Ole and Call by reference

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I want to control LabWindows/CVI via ActiveX from Perl. So far I managed to
start the ActiveX server of CVI and I can also load a project. See code:

use Win32::OLE;
my $cvi = Win32::OLE->new('CVI.Application') or die "Oops, cannot start

But I have some problems to get some information back from the ActiveX
server, if I used call by reference.

$result = $cvi->GetNumProjectFiles($number);
printf "<$result ><$number>\n";

-> Output: <><0>

The $number is not filled by the called function.

Even if I assign any value to $number before calling GetNumProjectFiles(),
the value is not changed by the called function.

$number = "42";
$result = $cvi->GetNumProjectFiles($number);
printf "<$result ><$number>\n";

-> Output: <42><0>

Is it possible at all to use call by reference with Win32::Ole???
I found many examples which are using Excel, Word, Outlook and so on, but
they are only using the return value rather than any call by reference.

Thanks a lot, Thorsten

Re: Win32::Ole and Call by reference

Thorsten Walenzyk wrote:

> Is it possible at all to use call by reference with Win32::Ole???

Yes but you have to read the documentation right to the end - that's
where the instructions are hidden.

I've not used Win32::OLE in years but back from the days when I did here
are my contibutions some previous threads asking this exact same
question (including the one where I asked the question):

Site Timeline