On Wed, 13 Feb 2008, Michael Ellery wrote:
> Can Win32::OLE access methods/props marked as hidden in the IDL? There
> happens to be one property we have marked as such and I tried the
> naive thing:
>
> my $secret = $object->HiddenProperty
>
> ...and it was rejected. Is there some way to ask Win32::OLE to ignore
> the hidden attribute?

Win32::OLE doesn't care about the IDL or typelib; it calls the
IDispatch::GetIDsOfNames() on your object to figure out the dispatch id
for the method or property.

If your GetIDsOfNames() implementation doesn't return the dispatch ids
of hidden methods and properties, then there is still a way to call them
directly if you know the dispatch id:

    my $dispid = 1234;
    my $secret = $object->Invoke($dispid, @args);

For property assignments you would need to use LetProperty/SetProperty
methods instead of specifying the dispid as a hash key.

But if your IDispatch::Invoke() implementation doesn't even dispatch
to the hidden properties, then they will be inaccessible from Win32::OLE.

Note that methods/properties are typically marked as "hidden" because
they are not safe to be called via IDispatch, or don't have an Automation
compatible parameter list, or something like that.
 
Cheers,
-Jan


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to