Hi all,
I have two classes in my ActiveX DLL component. I wish to use properties from one class inside the other.
How do I do this? I'm I on the write lines with using Friend Properties.
Thanks, Paul
Printable View
Hi all,
I have two classes in my ActiveX DLL component. I wish to use properties from one class inside the other.
How do I do this? I'm I on the write lines with using Friend Properties.
Thanks, Paul
If you only want the classes that are in the DLL to use the properties, then yes, use Friend.
Hi, thanks for that. I can understand the theory behind using the Friend Properties, but having difficulty in putting it into practice!
EG
Class 1
Friend Property Get CustomerName() as string
CustomerName = mstrCustomerName
End Property
Private Property Let CustomerName(vData as string)
mstrCustomerName = vData
End Property
Class 2
I want to access this Property so whats the code???
Right now, only Class1 has Let access to your property. Use Friend on both the Let and the Get, and then in Class2, its just a matter of...
VB Code:
Dim mCls1 As New Class1 mCls1.CustomerName = "Joe"
Just like any other property.
OK I understand that. But if you Dim the class as new I will lose the contents of the Property.
I want Class 1 to Let and Get, but only Get the property from Class 2.
Thanks, Paul