Results 1 to 2 of 2

Thread: Passing user defined types

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Wink

    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


  2. #2
    New Member
    Join Date
    Jun 2000
    Location
    Finland
    Posts
    13

    Arrow

    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).


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width