Here is my issue, I am very new to C# and want to invoke a custom dll that I can't register using regsvr32. I figured out I need to use PInvoke somehow but need help since all the methods return void, the data is in the Msg pointer. Some of the functions will need to send data using Msg and then will receive back in a modified pointer.
Here is one example the message is a structure that is passed to GetTMVersionInf o ( TM_Message* Msg ) and by sending a blank message it will modify the TM_Message pointer with the real data. The dll is for a keyboard I need to write drivers to, a Bosch Intuikey.
typedef struct
{
BYTE Msg[MAX_MSG_LEN];
int MsgLen;
} TM_Message;
TM_Message will be used as an output parameter for all API’s. All API’s will return the formed packet in
TM_Message structure.
• Msg will be the framed packet.
• MsgLen will be the length of packet.
• MAX_MSG_LEN is a macro, having value 80.
void GetTMVersionInf o ( TM_Message* Msg )
This API will be used to form packet for information message “Get_Version”. Formed packet will return in output parameter TM_Message.
Input Parameters: None
Return Type: Void
remember I am new to C# and not good at C, been a while so type slowly so I can understand :-)
Thanks
John
Here is one example the message is a structure that is passed to GetTMVersionInf o ( TM_Message* Msg ) and by sending a blank message it will modify the TM_Message pointer with the real data. The dll is for a keyboard I need to write drivers to, a Bosch Intuikey.
typedef struct
{
BYTE Msg[MAX_MSG_LEN];
int MsgLen;
} TM_Message;
TM_Message will be used as an output parameter for all API’s. All API’s will return the formed packet in
TM_Message structure.
• Msg will be the framed packet.
• MsgLen will be the length of packet.
• MAX_MSG_LEN is a macro, having value 80.
void GetTMVersionInf o ( TM_Message* Msg )
This API will be used to form packet for information message “Get_Version”. Formed packet will return in output parameter TM_Message.
Input Parameters: None
Return Type: Void
remember I am new to C# and not good at C, been a while so type slowly so I can understand :-)
Thanks
John
Comment