CreateObject vs New

  • Thread starter Thread starter Eric Brooksby
  • Start date Start date
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
 
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
 
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
 
Back
Top