Results 1 to 2 of 2

Thread: tricky COM inheritance question (resolved)

  1. #1

    Thread Starter
    Hyperactive Member Scott Penner's Avatar
    Join Date
    Dec 2000
    Location
    Mountain View
    Posts
    327

    Unhappy tricky COM inheritance question (resolved)

    I am writing a COM object that has one base class that the rest of the classes implement.

    As an example, let's say I have an object IMessage that has one empty subroutine, Show. Then I have two classes SnailMail and Email that implement IMessage.

    Is it possible now to add another class, let say "Fax", to the COM object without breaking the clients?

    I tried to do it like this:
    dim clsMessage as IMessage

    set clsMessage = CreateObject("MessageObject.SnailMail")
    clsMessage.Show

    This works great, but I have to recompile each time I add a new class to the MessageObject COM object.

    It was my impression that, by using Automation, e.g. CreateObject() syntax, I would be able to update the COM server without any problem.

    What am I missing, or is this impossible? When I try to instantiate the class after I change the COM server, I get a "Type Mismatch" error.

    Thanks in advance,
    Last edited by Scott Penner; Dec 14th, 2001 at 07:27 PM.
    -scott
    he he he

  2. #2

    Thread Starter
    Hyperactive Member Scott Penner's Avatar
    Join Date
    Dec 2000
    Location
    Mountain View
    Posts
    327
    Nevermind, I figured it out.

    If I make a type separate libary and use that interface to implement in the classes in my COM Object, then everything works!

    I wish I could say I knew why...But, getting it to work is half the battle.
    -scott
    he he he

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