MadraghRua has asked for the wisdom of the Perl Monks concerning the following question:
This is my interpretation of this in Perl:var server = new ActiveXObject("DataServer.Access"); var data = server.Object.Item var tool = new ActiveXObject("ToolServer.Tool"); findResult(data,tool); function findResult(data,tool) { tool.Clear; tool.Data = data; ... }
Its the second last line that I don't understand. If I understand what I am supposed to do, the $tool object needs to have the Data attribute populated with the $data object. When I dump $data and $tool, I see hashes populated with data. For instance in $tool I can see:#!/usr/bin/perl -w use strict; use Win32::OLE; use Dumpvalue; my $dumpvalue = Dumpvalue->new; my $server = Win32::OLE->new('DataServer.Access'); my $data = server->Object->Item; my $tool = Win32::OLE->new('ToolServer.Tool'); $tool->clear; $tool->Data = $data; $dumpvalue->dumpValue(\$tool);
and so on. So in this hash you can see that 'Data' => undef - I would like it set to $data.'Completed' => 0 'Error' => '' 'Data' => undef 'Results' => Win32::OLE=HASH(0x209d2f4) 'Count' => 0 'Item' => undef 'Settings' => Win32::OLE=HASH(0x2098ae4) ...
I have looked the the documentation for Win32::OLE and I'm simply not clear on what the syntactic sugar is that I need to assign the $data instance to the $tool->Data attribute. What I have shown typically throws the following warning: Win32::OLE(0.1707) error 0x80020003: "Member not found" in PROPERTYPUTREF "data" at script.pl line 12
I've tried variations on assigning the $data instance to $tool->Data,including
and so on.$tool->Data = $data; $tool{Data} = $data; $tool{'Data'} = $data; $tool{'Data'} = $$data;
I'm also open to any suggestions on what to try next. I'm also interested in finding out anything that that would allow me to observe the contents of the Jscript variables so I could better understand what is being passed there and where it is going.
Thanks!
MadraghRua
yet another biologist hacking perl....
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Working with COM objects
by ig (Vicar) on May 22, 2009 at 00:20 UTC | |
Re: Working with COM objects
by MadraghRua (Vicar) on May 22, 2009 at 19:07 UTC | |
by Anonymous Monk on May 23, 2009 at 07:21 UTC | |
Re: Working with COM objects
by MadraghRua (Vicar) on May 22, 2009 at 17:37 UTC | |
by Anonymous Monk on May 22, 2009 at 18:47 UTC |