mark pryor <[EMAIL PROTECTED]> wrote: > Yes, it does not work. Most, if not all of us, have wasted > uncountable amounts of time running into this same brick wall. Back > in Winter-2004 I wrote a small page about it and I have recently > restored it to my site. > > What Active State has done in place of Tlbinf32 objects is build in > methods to Win32::OLE::CONST to accomplish the same things. Frankly > most of these exports seem almost hidden to me, but you can find > samples of their use buried here and there in modules.
Hi Mark, I'm surprised that this has never been pointed out directly to me. I just looked into the issue, and the problem is indeed a bug in tlbinf32.dll: When Win32::OLE tries to instantiate an object using CoCreateInstance, requesting an IDispatch pointer, it reports that the interface is not supported. You can however request an IUnknown interface and then use QueryInterface to get an IDispatch interface from there. This at least violates COM best practices (requires additional roundtrips for remote servers) and may even violate the COM transitivity rule, at least in spirit. Anyways, I've added code to Win32::OLE to use the method outlined above as a fallback when the initial call fails. I've verified that with this change the sample code in the previous message works (after substituting .= for += as the string concatenation operator). The change is in the (unreleased) Win32::OLE 0.1707 and will most likely appear in ActivePerl 5.8.8.818 later this month. > see http://www.tlviewer.org/ASTypelib Much of the information on that page is wrong, as far as the conspiracy theories are concerned. I could go over it in detail, but it is probably not worth the time. As for the typelib and typeinfo interfaces in Win32::OLE: they are indeed intentionally undocumented. I played around with PerlScript and DHTML for GUI application and wrote the OLE browser as a sample project. I implemented the various functions for Win32::OLE::TypeLib etc as needed for the browser with the intend to eventually refactor them into more generally useful APIs. But I ran out of time, and I did not see much interest from anyone else in these APIs, so I never got around to it. And yes, I did write both the browser and these functions in 98-99 before I started working for ActiveState. Cheers, -Jan PS: "Jan" is actually a male name in almost all European languages (and for an English speakers it should be pronounced as if it were written "Yan"). :) _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs