Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New or CreateObject???
Message
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00513525
Message ID:
00514414
Views:
16
I've run into an interesting, and I would way somewhat annoying, behavior related to this discussion....

Let's say that you have registered more than one class with the same name... here's a simple example -- you have a class called MyClass in "C:\My Documents." Then, you move MyClass somewhere else and register it again....

... well, regardless of which class you add to the project references, when using CreateObject(), VB grabs the first instance it finds in the registry when creating the object. I have run into this several times, and you might, too.... The NEW keyword always grabs the Project Reference file, while CreateObject might not.

I don't think this is necessarily a reason not to use CreateObject() -- it's just a gotcha to be aware of....
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform