Marshal strings / byte arrays / structs -
12-18-2007
, 06:22 AM
Hello,
I have the following functions that are from a native Win32 dll.
Can someone help me to use them from CSharp?
extern ABS_StatusType ABS_WriteInArea( void* pxPath,
UINT16
iOffset, UINT8* pbData,
UINT16
iAmount, UINT16 iTimeout );
pxPath is a number
pbData is suposed to be an byte array
extern ABS_StatusType ABS_UserSelectPath(
UINT32*
plPathId,
void**
ppxPath );
ppxPath is a string to be retrieved
extern ABS_StatusType ABS_SendMail(
void* pxPath,
ABS_MailboxType* psMail,
UINT16
iTimeout );
How coud I use tha type ABS_MailboxType?
typedef struct ABS_MailboxType
{
/*
** The standard Mailbox header information
*/
UINT16 iId; /* Message
ID */
UINT16 iInfo; /* Message
Information */
UINT16 iCommand; /*
Command */
UINT16 iDataSize; /* Data
size */
UINT16 iFrameCount; /* Fragmentation: Total number of
frames */
UINT16 iFrameNo; /* Fragmentation: This frame
number */
UINT16 iOffsetHi; /* Fragmentation: Data offset
address */
UINT16 iOffsetLo; /* Fragmentation: Data offset
address */
/*
** The header extended and the mailbox data.
*/
UINT16 aiExtended[ 8 ];
UINT8 abData[ 256 ];
}
ABS_MailboxType; |