Hi Like,

I'm not aware of any modules for this. A *long* time ago I started
working on a Win32::COM implementation, but abandoned it because almost
all "interesting" COM components support IDispatch properly. You are
really running into a case where the developer of the component hasn't
been thinking of scripting support properly.

Here is a good overview of techniques for component developers to make
sure that the functionality of all their interfaces remains scriptable:

    http://www.sellsbrothers.com/tools/multidisp/

I think your options to proceed are:

1) Find a different component that does what you need.
2) Get the component developer to fix the IDispatch interface.
3) Create a wrapper object in C++ that is scriptable.
4) Write a Perl module using XS that makes the object accessible.
5) Use PerlNET from the Perl Dev Kit to access the object
   from .NET through native COM.

Options 3 to 5 all involve considerable effort, so 1 and 2 are
much preferable, if at all feasible.

Cheers,
-Jan

On Wed, 10 May 2006, like wrote:
> Hi Jan,
>
> Thanks. Are there any perl modules to solve this problem?
>
> Regards,
>
> Like
>
On Tue, 09 May 2006, "Jan Dubois" <[EMAIL PROTECTED]> wrote:
>> On Sat, 06 May 2006, Like Ma wrote:
>>> Hi Jan,
>>>
>>> I am sure that it does. I can call the methods of IJob, but I can't
>>> call any method of ISourceCollection. Is there a method in
>>> Win32::OLE like QueryInterface in C++ ?
>>
>> There is an undocumented QueryInterface method in Win32::OLE but it
>> will not do you any good unless you are dealing with a seriously
>> broken COM object. It will query the IDispatch interface for an IID,
>> but then will have to perform another QueryInterface to get the
>> IDispatch interface again. If the object properly conforms to COM
>> rules, then it will just return the original IDispatch interface
>> again, and you are back where you started.
>>
>> I think your ISourceCollection interface is simply not OLE Automation
>> compatible. There is a reason the module is called Win32::OLE and not
>> Win32::COM. You *cannot* access arbitrary COM interfaces, only
>> IDispatch.
>>
>> Cheers,
>> -Jan



_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to