|
-
Aug 15th, 2003, 05:59 AM
#1
Thread Starter
Lively Member
Private Communication between classes
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
-
Aug 15th, 2003, 07:46 AM
#2
If you only want the classes that are in the DLL to use the properties, then yes, use Friend.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Aug 15th, 2003, 07:57 AM
#3
Thread Starter
Lively Member
Example?
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???
-
Aug 15th, 2003, 07:59 AM
#4
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.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Aug 15th, 2003, 08:54 AM
#5
Thread Starter
Lively Member
OK
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
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
|