jackjohnson44
asked on
vb.net return a class from a function, but don't know what kind of class gets returned
I have a vb6 app that calls a function which returns a class
Dim stepToBeProgrammed As Object
Set stepToBeProgrammed = getClassOrFormFromStep(ste pNameLong, "class")
The function getClassOrFormFromStep, is set up to return an object, in this case a class.
Is this how I should do it in vb.net?
Does setting the object cast it's type?
Is there a performance issue here?
Dim stepToBeProgrammed As Object
Set stepToBeProgrammed = getClassOrFormFromStep(ste
The function getClassOrFormFromStep, is set up to return an object, in this case a class.
Is this how I should do it in vb.net?
Does setting the object cast it's type?
Is there a performance issue here?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Instead of object, I set the variable to the base class.
Thanks
Thanks
ASKER
I don't know what type of class will be returned, is it ok to have my function return type object?
Or is there a better way to do it?
Public Function returnclass(ByVal mu As Integer) As object
Return New MyNewClass
End Function