Boniek has asked for the wisdom of the Perl Monks concerning the following question:
coclass myCoclass { [default] interface ImyCoclass; interface ImyWantedinteface; [default, source] dispinterface IOtherEvents; };
PerlConnectToServer(myCo, "FOO.myCoClass") Dim myCoInternal As FOO.imyWantedinterface Set myCoInternal = myCo ' now myCoInternal can access ImyWantedinterface's methods myCoInternal.doit ' Works
Is there anyway of choosing the interface which I want to query within the object? I have searched loads for a solution but I have not found any answers. I'm no expert on COM and the declarations but it seems to me this is an unusual way to actually declare the COM interface and therefore it might not be implemented in the Win32::OLE?use Win32::OLE my $myCo = Win32::OLE->new('FOO.myCoClass') or die "Cannot create obje +ct"; # Works without problems my $myCoInt = Win32::OLE->new('FOO.ImyWantedinteface') or die "Cannot + create object"; # Gives invalid class string # Also given method doit is in the ImyWantedinterface's declaration $myCo->doit(); # Fails
|
|---|