|
-
Jun 8th, 2001, 04:49 PM
#1
Thread Starter
Junior Member
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.
-
Jun 8th, 2001, 05:28 PM
#2
Lively Member
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.
-
Jun 12th, 2001, 04:59 PM
#3
PowerPoster
Code:
Dim oCar as New CCar
Dim oVehicle as IVehicle
Set oVehicle = oCar
-
Jun 12th, 2001, 06:05 PM
#4
Lively Member
-
Jun 13th, 2001, 07:47 AM
#5
Thread Starter
Junior Member
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.
-
Jun 13th, 2001, 08:17 AM
#6
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|