Not sure if this is C++ or VB question or both.
I have a poor knowledge of C++ and have converted a C++ SDK to a regular DLL so I can use it in VB.
In VB I declare each function in the DLL as follows
This particular function sends serial data over a LAN to an Indigo Vision video codec.
In the VbAuxChannelConnect1 there is a call back option to let me know we have received a serial string.
The callback function I used to use in C++ is
How can I make this CALLBACK to me VB forms?
I have a poor knowledge of C++ and have converted a C++ SDK to a regular DLL so I can use it in VB.
In VB I declare each function in the DLL as follows
VB.NET:
Public Declare Function VbAuxChannelConnect1 Lib "IVserial.dll" (ByVal m_hDevice As Integer, ByVal IPAddressSerial As String, ByVal SerialPort As Int16, ByVal Priority As Int16, ByVal Persistance As Boolean) As Boolean
Public Declare Function VbAuxChannelSend1 Lib "IVserial.dll" (ByVal ASCIIStringSerial As String, ByVal SerialPort As Int16, ByVal m_hDevice As Integer) As Boolean
Public Declare Function VbAuxChannelDisconnect1 Lib "IVserial.dll" (ByVal SerialPort As Int16, ByVal m_hDevice As Integer) As Boolean
This particular function sends serial data over a LAN to an Indigo Vision video codec.
In the VbAuxChannelConnect1 there is a call back option to let me know we have received a serial string.
The callback function I used to use in C++ is
VB.NET:
void CALLBACK AuxChanCallback( void *pUserParam,
VBAUXTYPE nType,
void *pData,
int nSize )
{
char szReceivedData[1024];
char *pszSerialData = (char *)pData;
strncpy( szReceivedData, pszSerialData, nSize );
szReceivedData[ nSize ] = '\0'; // null terminate this string.
// print received serial data out
//printf("Received serial data from Transmitter: %s\n", szReceivedData);
return;
}
[COLOR="Blue"]and the exported function [/COLOR]
bool __stdcall VbAuxChannelConnect1(HANDLE m_hDevice,const char *IPAddressSerial, VBAUXTYPE SerialPort, int Priority, bool Persistant)
{
BOOL m_bStatus;
m_bStatus=VbAuxChannelConnect(
m_hDevice,
IPAddressSerial, // Transmitter IP
SerialPort,
Priority, // use a maximum priority for this connection if HW link. Else 1 low - 10 High
"MyConnection", // a friendly name for this connection
Persistant, // persist flag, ignored for PC serial connections
[COLOR="Red"]AuxChanCallback[/COLOR], // callback function which receives serial data from Transmitter
NULL
);
How can I make this CALLBACK to me VB forms?