But it's certainly been interesting getting to the bottom of this, and it's given me a greater appreciation of the "dynamic" implementation! Ah, who cares, I'm over it. But not a lot of third parties except for me and a few other crazy people ever used ActiveX on the Mac. Another side note on this: The system also needs to be sure that the GC doesn't do anything interesting with memory contents while it's performing to copy to the variant. I've played with it a bit and it looks interesting, but I've not gone any further than his method querying code he retrieves a list of methods but doesn't examine the arguments that the methods take, for example.
Glad you asked! One of my favorite topics. ) COM is essentially a formal way o Hacker News
IDispatch::GetTypeInfo, Retrieves the type information for an object, which can then be used to get the type information for an interface. ActiveX or OLE objects can implement the IDispatch interface for access by ActiveX clients, such as Visual Basic. The IDispatch interface was initially designed to support Automation.
Sort of like "dynamic" much on a more conservative scale :.
If you don't want it to try to cast the return value then specify "object" as the type param. By essentially I did mean actually, or literally in the literal sense in the literal sense in the literal sense The final code I've ended up with doesn't seem that complicated in and of itself, but I feel like I've gone through the wringer a bit trying to confirm that it's actually correct!
The first thing to do is to cast the object reference to the IDispatch interface this will only work if the object implements IDispatch, for the COM components I was targetting this was the case. Since at each insertion into the unmanaged memory I've allocated I'm using Marshal. And it revealed that I didn't know very much about the unsafe and fixed keywords :.
Extending IUnknown, it is References. ^ Microsoft MSDN: IDispatch interface; ^ Microsoft MSDN: ActiveX/COM Q&A December The IDispatch interface exposes objects, methods and properties to http://msdn (v=vs).aspx.
ATL was popular for implementing all kinds of Internet Explorer plug-ins.
Creating the IDispatch Interface Microsoft Docs
It also had a lot of persistence, runtime reflection, and user-interface related stuff for plugging components and dialogs together in windows, providing property sheets, editing and configuring controls, etc. From what I've learnt about pinning and its effects on the garbage collector, the "fixed" call in the MSDN example is to lock the array in place while it's being iterated over. From what I understand and I'd never used Marshal. They were extremely popular and became a victim of their own success, after a whole industry grew up around them, and people started using them for all kinds of things they weren't intended for, and wanted to use them from other languages and frameworks like Borland.