|
-
Dec 4th, 2014, 07:33 PM
#1
[RESOLVED] COM Pointers Please (Pun Intended)
Good day. I know there are some really competent COM (Component Object Model) people out there and in a personal quest for better understanding of COM and VB6, I have a question, but be forewarned that I am using class/interface interchangeably, right or wrong.
Let me use the stdFont as an example. From some testing, the stdFont seems to look like the following:
Class that implements 3 other classes:
Font aliased as IFontDisp
FontEvents aliased as IFontEventsDisp
IFont (VB's Object Browser doesn't show it as implemented by stdFont)
1) ObjPtr(Me.Font) is provided for testing, but just the pointer, no knowledge of what it is pointing to.
2) If I call IUnknown.QueryInterface for IDispatch implementation, I can get some really good info via that interface
From that info, I have determined that the class that IDispatch is for, is the Font/IFontDisp class. Seems to be verified when calling: TypeName(Me.Font). Great, but for educational purposes, this is my question:
How can I determine what class, if any, is implementing that specific instance of Font/IFontDisp? If I get the ITypeLib from IDispatch>ITypeInfo, I can enumerate the library & see that the stdFont implements Font/IFontDisp among 2 other classes, but I'd like to navigate up the class to end at the source, what I assume will be the stdfFont class, not the Font/IFontDisp
Again, this is for self-education.
Edited: After re-reading this, I realize didn't phrase my question correctly. ObjPtr(Me.Font) & ObjPtr(IFontDisp), return the same pointer, as expected. My question is really: how do I know that the ObjPtr() provided is for a sole-instance of IFontDisp class or the IFontDisp class being implemented by another class & if so, what other class(es)?
Last edited by LaVolpe; Dec 4th, 2014 at 07:54 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|