About using the text box example ...
I had this exact same problem using VB6, when I tried to pass a ComboBox as a parameter into a subroutine that was in another DLL. Fortunately, I was working at Microsoft at the time, so I went down the hall to one of the people who developed the VB language.
She said that it had something to do with threading. Since a ComboBox is a seperate OCX (a private object module), you will have difficulty in trying to pass it as a parameter.
I was able to get around this by doing the following :
'borrowing your code
Private ocTextBox As Object
Public Property Set TextBox(ByRef vData As Object)
Set ocTextBox = vData
End Property
Public Property Get TextBox() As Object
Set TextBox = ocTextBox
End Property
Using the data type Object, ocTextBox can't be dimensioned as WithEvents, and it will have to be initialized outside of the dll. But it did allow me to pass the object into another dll.
Samwise Galenorn
[email protected]