Results 1 to 6 of 6

Thread: hiding interfaces in COM

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Chicago, IL
    Posts
    26

    hiding interfaces in COM

    Hey all,

    I want to hide the Interfaces so that they do not show up when i create them in VB. I'm aggregating for example object bar into object Foo. When I add a reference to foo.dll in VB and try to create the object using createobject intellisense shows foo.IBar which I don't want to show up, but when I use new it does not How would I hiding the IBar interface from VB?


    Thanks!
    hope this is not too confusing.

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    Azh,
    You can't hide an Interface in COM. The implementation of a COM component is only accessable through its interfaces. You don't see the Interface when you use the New keyword because you can't instantiate an Interface.

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Code:
        Dim oCar as New CCar
        Dim oVehicle as IVehicle
    
        Set oVehicle = oCar

  4. #4
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    Yeah, and ... ??

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Chicago, IL
    Posts
    26

    actually it can be done

    you can use the hidden keyword in the idl to "hide" the interfaces you do not want the user to see.

  6. #6
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    You're right about the 'hide' keyword, but then you should define your interfaces in IDL compile it to get the TypeLib and use it in VB.

    So only in VB it's not possible !!

    By the way, 'as new' you shouldn't use !!
    (Your component will be instantiated by the VB Runtime and not COM)

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