Win32::Ole and Call by reference

Win32::Ole and Call by reference

am 22.10.2004 11:06:02 von Thorsten Walenzyk

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
CVI";
$cvi->OpenProject("C:\\USERS\\tp_remix_443\\tp_remix_443.prj ");

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

am 23.10.2004 10:23:09 von Brian McCauley

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):

http://groups.google.com/groups?selm=u9u1bmzu69.fsf%40wcl-l. bham.ac.uk
http://groups.google.com/groups?selm=u9d76ymutp.fsf%40wcl-l. bham.ac.uk
http://groups.google.com/groups?selm=u9pues8xjg.fsf%40wcl-l. bham.ac.uk

Re: Win32::Ole and Call by reference

am 23.10.2004 10:23:09 von Brian McCauley

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):

http://groups.google.com/groups?selm=u9u1bmzu69.fsf%40wcl-l. bham.ac.uk
http://groups.google.com/groups?selm=u9d76ymutp.fsf%40wcl-l. bham.ac.uk
http://groups.google.com/groups?selm=u9pues8xjg.fsf%40wcl-l. bham.ac.uk