http://www.perlmonks.org?node_id=765721


in reply to Working with COM objects

Alas I tried this and several variations on the theme but to no avail.

OK, so here's the question reconfigured - I have two instances of two separate COM objects - tool and data. Tool instance has several attributes and a couple of methods. However one of the attributes is that it takes an instance of a data object for Tools->{data}. When I look at these things via Dumpvalue, I see that objects are typically represented in the data structure as a hash address and then you see a cascade of the data present under that hash address. So in the example above, I can see tools->{Results} has a Win32::OLE hash address and then you see the data under it.

How would I do something like this for my Data object - perhaps there is something FUBAR'd under creating this Win32::OLE hash address for this COM object and simply supplying this would solve the problem. I've tried passing $data instance as /$data and as a passed reference

$thingref = /$data; $tool->{Data} = $thingref;
I know in Jscript that I can simply pass set tool.Data = data How do I do this in Perl?

Win32::OLE is the best way to tackle this - yes? Or is there something else I should be looking at?

Thanks!

MadraghRua
yet another biologist hacking perl....

Replies are listed 'Best First'.
Re^2: Working with COM objects
by Anonymous Monk on May 22, 2009 at 18:47 UTC
    | \|/ V my $data = server->Object->Item; ^ /|\ |