CreateObject vs New

E

Eric Brooksby

Ok, so I am a bit new with asp.net. I have done everything to import
the com object correctly in ASP.NET and the following line works like
a charm.

Dim MeSrvCtrl As New MeSrvCtrlClass


Why does the following line not work?


MeSrvCtrl = CreateObject("MeSrvCtrlClass", Myserver_name)


As far as I can read these two are supposed to be basicaly the same.
Any help would be appriciated.

Eric
 
G

Guest

well there is difference between create object and new method for creating
objects
create object cannot be used if instancing property of class is set private
or public not creatable.
Check that
 
K

Kevin Spencer

Hi Eric,

Those two are far from the same. The Visual Basic CreateObject function is
for the purpose of instantiating COM objects, not .Net classes.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top