Send a User Defined Type using Winsock


I am trying to send a type i created

Public Type info
command As String
directive As String
data() As Byte
End Type

from one computer to another using a winsock control.
but when I try I get the error

Only user-defined types defined in public object modules
can be coerced to or from a variant or passed to late
bound functions.

If anyone knows how to do this it'ld save me another 7 or 8
hours worth of research and trial and error.

Comments

  • :

    : I am trying to send a type i created
    :
    : Public Type info
    : command As String
    : directive As String
    : data() As Byte
    : End Type
    :
    : from one computer to another using a winsock control.
    : but when I try I get the error
    :
    : Only user-defined types defined in public object modules
    : can be coerced to or from a variant or passed to late
    : bound functions.
    :
    : If anyone knows how to do this it'ld save me another 7 or 8
    : hours worth of research and trial and error.
    :
    :

    << ...user-defined types defined in public object modules... >>

    In other words, move the Type definition to a .bas module.

    Another option is to break the UDT down into it's parts, send them through and reassemble on the other side.
  • : :

    : : I am trying to send a type i created
    : :
    : : Public Type info
    : : command As String
    : : directive As String
    : : data() As Byte
    : : End Type
    : :
    : : from one computer to another using a winsock control.
    : : but when I try I get the error
    : :
    : : Only user-defined types defined in public object modules
    : : can be coerced to or from a variant or passed to late
    : : bound functions.
    : :
    : : If anyone knows how to do this it'ld save me another 7 or 8
    : : hours worth of research and trial and error.
    : :
    : :
    :
    : << ...user-defined types defined in public object modules... >>
    :
    : In other words, move the Type definition to a .bas module.
    :
    : Another option is to break the UDT down into it's parts, send them through and reassemble on the other side.
    :

    Oh, and this site has HTML support removed. When posting a message, click the link near the bottom to find out what codes are supported.
     is "code" surrounded by [].
  • : : :

    : : : I am trying to send a type i created
    : : :
    : : : Public Type info
    : : : command As String
    : : : directive As String
    : : : data() As Byte
    : : : End Type
    : : :
    : : : from one computer to another using a winsock control.
    : : : but when I try I get the error
    : : :
    : : : Only user-defined types defined in public object modules
    : : : can be coerced to or from a variant or passed to late
    : : : bound functions.
    : : :
    : : : If anyone knows how to do this it'ld save me another 7 or 8
    : : : hours worth of research and trial and error.
    : : :
    : : :
    : :
    : : << ...user-defined types defined in public object modules... >>
    : :
    : : In other words, move the Type definition to a .bas module.
    : :
    : : Another option is to break the UDT down into it's parts, send them through and reassemble on the other side.
    : :
    :
    : Oh, and this site has HTML support removed. When posting a message, click the link near the bottom to find out what codes are supported.
     is "code" surrounded by [].
    :
    I had it in a module already when it gave me the error. I could break it down and send it peace by peace, but i'ld rather send the entire structure. So do you know why I'm getting the error.
    thanks for the quick reply.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories