-
I`m want to pass a user defined type from a class to a form, but I cant get it to work. Any ideas?
This is what I've got:
Code:
'header.bas
Public Type param_struct
lngIdent As Long
intDataLength As Integer
lngRecOverrunFlag As Long
lngRCVFIFOLostMsg As Long
typData As DataValues
lngAckOverrunFlag As Long
lngXMTAckFIFOLostAcks As Long
lngXMTRmtFIFOLostRemotes As Long
lngBusState As Long
lngErrorState As Long
lngCan As Long
lngTime As Long
End Type
' Class
Option Explicit
Public Event CanEvent(ByVal node As Byte, ByRef param As param_struct)
Public Sub Canread()
'code...
RaiseEvent CanEvent(node, param)
'code...
End Sub
'form
Public WithEvents Can As Class1
Private Sub Can_CanEvent(ByVal node As Byte,byref param as param_struct) ' event handler
end sub
Cheers
-
Ditto!
I'm having the exactly same problem. All I can get from VB is
"Compile Error: Only public user defined types defined in
object modules can be used as parameters or return types
for public procedures or class modules or as fields of
public user defined types."
However, this is exactly how I, and Rick, have been trying to go at it (at least as far as I can see).