I have a large .net solution that has a lot of projects in it.
My question is, when referencing one project from another, is it better to do this:
Dim objSomething As Project.Class1 = Nothing
objSomething = CreateObject("Project.Class1")
Dim objSomething As New Project.Class1()
You'd have to try it both ways and measure it to be sure, but there should not be any significant performance difference if
Class is a pure COM-object.
Other than that, there's no difference since
objSomething is typed as a
Project.Class1 in both cases so everything after that is early-bound.
Project.Class1 is a .NET object that is com-callable, then you should ALWAYS use
New because you bypass the COM-interop layer which WILL have a performance impact. There's no point in creating a .NET class through a COM interop layer.