Author |
Topic |
|
trebro
1 Posts |
Posted - 31 Oct 2003 : 11:50:31
|
I am trying to connect to a CAN J1939 protocal BUS. I have a .dll we have developed in eC++ that will talk on the J1939 bus. The thing is that the functions in the library require structures. Does anyone know how to pass structures from eVB to and from the .dll?
-------------------------- code from the .dll header -------------------------- typedef struct { UCHAR length, sAddr, priority; UCHAR data[MAX_J1939_PKT_SIZE]; ULONG pgn; } J1939_PKT;
typedef struct { WORD length; UCHAR data[MAX_J1708_PKT_SIZE]; UCHAR mid; WORD pid; } J1708_PKT;
typedef struct { LONG pos; BYTE type; J1939_PKT j1939; J1708_PKT j1708; } VAN_PKT;
//functions I need to use from .dll BOOL VAN_CreateJ1939Msg(VAN_PKT& pkt, BYTE priority, BYTE sa, ULONG pgn, PBYTE data, BYTE len); BOOL VAN_TransmitMessage(VAN_PKT&); BOOL VAN_ReceivePacket(VAN_PKT& pkt); ----------------------------- ------------------------------------------- code in the eVB program to include the .dll ------------------------------------------- Public Declare Function VAN_ReceivePacket Lib "CBridge.dll" (pkt As String) As Boolean Public Declare Function VAN_CreateJ1939Msg Lib "CBridge.dll" (pkt As String, priority As Byte, sa As Byte, ByVal pgn As Long, ByVal data As Byte, length As Byte) As Boolean Public Declare Function VAN_TransmitMessage Lib "CBridge.dll" (pkt As String) As Boolean ------------------------------------------- I have the pkt structure defined as a string since everywhere I have read eVB, actually VBCE does not deal with structures. Does anyone know how to help?
|
|
ctacke
877 Posts |
Posted - 31 Oct 2003 : 12:50:51
|
Since eVB doesn't support UDTs, structures must be passed in byte form, defined as a String. For and example, take a look at this tutorial on the ListView:
http://www.innovativedss.com/lvtutorial1.asp |
|
|
ctacke
877 Posts |
|
|
Topic |
|
|
|