All Forums
 Microsoft Windows CE
 eVB Application Development
 Structures?????? [passing data structures to eVB]
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

trebro

1 Posts

Posted - 31 Oct 2003 :  11:50:31  Show Profile  Email Poster
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  Show Profile  Email Poster
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
Go to Top of Page

ctacke

877 Posts

Posted - 03 Nov 2003 :  12:42:47  Show Profile  Email Poster
Here are a couple more articles covering using UDTs in eVB:

http://www.devbuzz.com/content/zinc_evb_pocketfont_pg1.asp
http://www.devbuzz.com/content/zinc_evb_accessing_files_api_pg1.asp
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000