Results 1 to 13 of 13

Thread: [RESOLVED] COM Pointers Please (Pun Intended)

Threaded View

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Resolved [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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width