Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Working with COM objects

by MadraghRua (Vicar)
on May 22, 2009 at 19:07 UTC ( [id://765728]=note: print w/replies, xml ) Need Help??


in reply to Working with COM objects

Alright, I had a deeper look into Win32::OLE and came across the following

$tool->LetProperty('Molecule',$data); $tool->setProperty('Molecule, $data);
So it turns out that the LetProperty method loads the $data instance into the Molecule attribute of the $tool instance. I'll be looking more closely at this to understand why this worked over the previous syntactic sugars that i was using.

I hope this node helps someone else in the future

MadraghRua
yet another biologist hacking perl....

Replies are listed 'Best First'.
Re^2: Working with COM objects
by Anonymous Monk on May 23, 2009 at 07:21 UTC

    In Win32::OLE property assignment using the hash syntax is equivalent to the Visual Basic Set syntax (by reference assignment):

            $Object->{Property} = $OtherObject;

    corresponds to this Visual Basic statement:

            Set Object.Property = OtherObject

    To get the by value treatment of the Visual Basic Let statement

            Object.Property = OtherObject

    you have to use the LetProperty() object method in Perl:

            $Object->LetProperty($Property, $OtherObject);

    LetProperty() also supports optional arguments for the property assignment. See OBJECT->SetProperty(NAME,ARGS,VALUE) for details.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://765728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-23 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found