|
-
Jan 4th, 2001, 04:46 AM
#1
Thread Starter
New Member
'My Class Module contains this properties
Private WithEvents ocTextBox As TextBox
Public Property Set TextBox(ByVal vData As TextBox)
Set ocTextBox = vData
End Property
Public Property Get TextBox() As TextBox
Set TextBox = ocTextBox
End Property
When i compile this(DLL) it is giving the following error:
Private object modules cannot be used in public object modules as parameters or return types for public procedures as public data members,or as fields of public user defined types.
-
Jan 4th, 2001, 04:54 AM
#2
Lively Member
if i translate that error to simple words,
it says you can't return TextBox (in property get),
the way it is declared (private).
maybe you can change it to public?
maybe you can't really return TextBox data type?
who knows.
-
Jan 4th, 2001, 11:56 AM
#3
Member
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|