Question about VB "classes" 
Author Message
 Question about VB "classes"

I'm a C++ and delphi guy and just started using VB recently. I just want to
clarify something that doesn't seem to be spelled out in the VB help: are VB
classes/objects always COM objects? In other words, VB's OO mechanism is
entirely reliant on COM?

--
Uwe W. Radu
(leave capital letters only in host name to email me)



Mon, 19 May 2003 03:00:00 GMT  
 Question about VB "classes"



Quote:
> I'm a C++ and Delphi guy and just started using VB recently. I just want
to
> clarify something that doesn't seem to be spelled out in the VB help: are
VB
> classes/objects always COM objects? In other words, VB's OO mechanism is
> entirely reliant on COM?

Yes


Mon, 19 May 2003 03:00:00 GMT  
 Question about VB "classes"
That is true for the public interface of your components and applications.
However, VB will not create COM objects for classes that are not exposed
publicly. This is easy to test.
Start a VB EXE.
Add a Class Module with some properties
Create an instance of your class when the form loads.
While the app is still running and the instance created, search the registry
for the class (you will not find it). Further more, try to use a
CreateObject for your class instead of the New statement (you cannot do
that).

Hope this helps
--
Gerardo Villeda
MCP - MCSD
http://www.netreach.net/~gvilleda



Quote:
> I'm a C++ and Delphi guy and just started using VB recently. I just want
to
> clarify something that doesn't seem to be spelled out in the VB help: are
VB
> classes/objects always COM objects? In other words, VB's OO mechanism is
> entirely reliant on COM?

> --
> Uwe W. Radu
> (leave capital letters only in host name to email me)



Tue, 20 May 2003 03:00:00 GMT  
 Question about VB "classes"

Quote:
> Hope this helps

Sure does, Gerardo. VB does so many things implicitly and tacitly that it's
hard to see sometimes what exactly is going on.

While we're on the topic (sort of), can you create COM interfaces in VB
using the standard IName convention, rather than the silly _Name stuff? And
can you create just TLBs, without also creating a COM object in a DLL?

--
Uwe W. Radu
(leave capital letters only in host name to email me)



Tue, 20 May 2003 03:00:00 GMT  
 Question about VB "classes"
If you check "Remote Server Files" on the Component tab of the
Project Properties dialog, VB will generate a type library along
with the dll.  I think you need the Enterprise Edition for this
feature.  As an alternative you can generate IDL from OLEVIEW.EXE.

Regarding a previous post.  I am not sure it is accurate to say
that private objects are not COM objects just because VB
instantiates them internally.

Michael Keller


Quote:
> > Hope this helps

> Sure does, Gerardo. VB does so many things implicitly and tacitly that it's
> hard to see sometimes what exactly is going on.

> While we're on the topic (sort of), can you create COM interfaces in VB
> using the standard IName convention, rather than the silly _Name stuff? And
> can you create just TLBs, without also creating a COM object in a DLL?

> --
> Uwe W. Radu
> (leave capital letters only in host name to email me)



Fri, 30 May 2003 16:46:18 GMT  
 Question about VB "classes"

Quote:
> If you check "Remote Server Files" on the Component tab of the
> Project Properties dialog, VB will generate a type library along
> with the dll.  I think you need the Enterprise Edition for this
> feature.  As an alternative you can generate IDL from OLEVIEW.EXE.

I believe I do have Enterprise, though how do you find out? There's nothing
special in the About... box, yet I do have the "Remote Server Files" option,
and it does generate the *.vbr and what have you files. Till now I cheated
and used the type library editor in Delphi, which creates nice clean *.tlb
files and lets you edit interfaces graphically, without having to know IDL
(though you can always check the generated IDL on another tab, to get an
idea what's going on).

Quote:
> Regarding a previous post.  I am not sure it is accurate to say
> that private objects are not COM objects just because VB
> instantiates them internally.

That's what I was thinking also. Even if a class doesn't get registered, it
seems that VB is still relying on the COM mechanism for its OO. Essentially
all its objects are in-processes COM objects and the best performance it can
hope for is COM performance.

--
Uwe W. Radu
(leave capital letters only in host name to email me)



Fri, 30 May 2003 22:19:15 GMT  
 Question about VB "classes"

Quote:

>I am not sure how you can tell you have Enterprise.

That bit is easy, you just write a COM interface which talks to... heh, just kidding :)
It actually tells you on the splash screen at startup time, the service pack level is also on there.

sluggy



Tue, 15 Jul 2003 09:19:23 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

2. Which is difference between "Component Class" and "Class"?

3. VB Scripting Question -- "On Error"

4. "Access/VB/Bitmap/Wave Question?"

5. Question about VB's "Edition"

6. "duplicate definition" converstion->vb question

7. "VB/ACCESS/BITMAP/WAV Question?"

8. "VB/Access/Bitmap/Wave Question?"

9. Question about VB Function "Now"

10. Question about "pointers" in VB.

11. Question about "pointers" in VB.

12. Question about VB Function "Now"

 

 
Powered by phpBB® Forum Software