Yeah, no, what I mean is this:
MyClass
Public Function GetNew() As MyClass
Return New MyClass()
End Function
End MyClass
now, somewhere else I can do:
Public Sub MyFunction( objObject As Object)
Dim objObject1 As Object = objObject.GetNew()
Dim objObject2 As Object = objObject.GetNew()
End Sub
I want to do this, but without writing the GetNew() function for MyClass.
And MyFunction() does not know what type objObject will be.
"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:uA*************@TK2MSFTNGP12.phx.gbl...
Qwert,
How is it possible to create a NEW instance of the object MyClass inside
MyFunction (without adding functionality to MyClass)?
Something like:
Dim objNew As Object = CreateNewInstance( objMyClass )
You mean
Dim objNew as New TheMyClass
You cannot instance an object, that goes only for classes.
(Not to mixup that object is a class, however an object is an instanced
class)
I just am guessing that this was the question.
Cor