Z
Zahid
Hi,
I have a number of structures that I want to send using
UDP protocol. How do I convert the structure into
bytes/array of bytes? Using UDP protocol is a MUST - a
Client Requirement for my PocketPC application.
Am I doing it all wrong? Should I create Classes instead
of these objects- if so how does that help?
In particular How would I send/Convert the array "data()"
into Bytes to send with the structure?
This code is part of an Interface specification that
communicates with a program written C/MFC code.
Thanks in advance
Here is my code:
Public Structure xvnetpkt_type
Public id As Byte
Public prid() As Byte
Public seqno As UInt16
Public length As UInt16 'Length of data
Public code As Char 'reply Code -
Public data() As srvrlogon_type 'Data
Public Sub Initialize()
ReDim prid(2)
ReDim data(MAXDATA)
End Sub
End Structure
Public Structure srvrlogon_type
Public Request As Char
Public ServerNo As UInt16
End Structure
Structure sell_type
Public Request As Char '10 = sell items
Public TableNo As UInt16
Public SplitNo As UInt16
Public nItems As UInt16 'No of ITEMINFO2(max 60)
Public Items() As iteminfo2_type
Public Sub Initialise()
ReDim Items(60)
End Sub
End Structure
Structure iteminfo2_type
Public PLU As UInt64
Public Flags As UInt16
Public quantity As UInt16
End Structure
I have a number of structures that I want to send using
UDP protocol. How do I convert the structure into
bytes/array of bytes? Using UDP protocol is a MUST - a
Client Requirement for my PocketPC application.
Am I doing it all wrong? Should I create Classes instead
of these objects- if so how does that help?
In particular How would I send/Convert the array "data()"
into Bytes to send with the structure?
This code is part of an Interface specification that
communicates with a program written C/MFC code.
Thanks in advance
Here is my code:
Public Structure xvnetpkt_type
Public id As Byte
Public prid() As Byte
Public seqno As UInt16
Public length As UInt16 'Length of data
Public code As Char 'reply Code -
Public data() As srvrlogon_type 'Data
Public Sub Initialize()
ReDim prid(2)
ReDim data(MAXDATA)
End Sub
End Structure
Public Structure srvrlogon_type
Public Request As Char
Public ServerNo As UInt16
End Structure
Structure sell_type
Public Request As Char '10 = sell items
Public TableNo As UInt16
Public SplitNo As UInt16
Public nItems As UInt16 'No of ITEMINFO2(max 60)
Public Items() As iteminfo2_type
Public Sub Initialise()
ReDim Items(60)
End Sub
End Structure
Structure iteminfo2_type
Public PLU As UInt64
Public Flags As UInt16
Public quantity As UInt16
End Structure