Click to See Complete Forum and Search --> : ActiveX Dll


astonk2
October 19th, 2001, 04:05 PM
I am creating a ActiveX Dll. Within my Dll I have a class (Thing.cls) and a form (frmThing). My Question is, How can I pass data from frmThing to Thing.cls without making a public Sub/Function in Thing.cls. I included code fragment below.

'-: ActiiveX Dll

Option Explicit

'Thing: Class

Private m_TheForm As Form

Private Sub Class_Initialize()

Set m_TheForm = new frmThing

End Sub
.
.

____________________________________________________________

Option Explicit

'frmThing: Form
.
.
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

Dim byaData() as Byte
Redim byaData(bytesTotal)

Winsock1.GetData byaData

'For example:
'Need to pass byaData here back to Thing.cls
'But do not want the function to be
'accessable by the dll user.

End Sub

JHamilton
October 19th, 2001, 04:22 PM
Use a Friend function in your class. It is only visible to the project itself and not the instantiater.


friend mySub(myVar as byte)
... modify your member variables here.
End Sub




Software is like sex, it's better when it's free - Linus Torvalds
Software is like sex, it's better when I get paid for it. - me