I have a set of class modules all implementing the same interface.
I have a form that lists all classes that implement the interface in a combobox. So far so good!
What I want to do is create a new object based on what the user selects, but the closest I can get is the VBComponent.
What I'd like to do is "cast" that vbcomponent into a new object, but for the life of me, I can't work out how. Is this even possible? Oh for some reflection!!
Ben
----------------------------------------------
Ben O'Hara
Code:
Implements ISQL
I have a form that lists all classes that implement the interface in a combobox. So far so good!
What I want to do is create a new object based on what the user selects, but the closest I can get is the VBComponent.
Code:
Private downloadFile As ISQL
Private Sub cboSelectList_Change()
Set downloadFile = VBProj.VBComponents(cboSelectList.Text)
End Sub
What I'd like to do is "cast" that vbcomponent into a new object, but for the life of me, I can't work out how. Is this even possible? Oh for some reflection!!
Ben
----------------------------------------------
Ben O'Hara
David W. Fenton said:We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.