Hi,
got this c api interface:
#ifndef _USBCDDLL_HPP
#define _USBCDDLL_HPP
#define DEVICE_COMMANDOK 0
#define DEVICE_IDERROR 1
#define DEVICE_BUSY 2
#define DEVICE_UNKNOWERROR 3
extern "C"
{
typedef void (CALLBACK* CDDeviceChangePROC )(int);
WINUSERAPI VOID WINAPI InitUSBCDLibrary();
WINUSERAPI VOID WINAPI CloseUSBCDLibrary();
WINUSERAPI VOID WINAPI SetCDCallbackProc( CDDeviceChangePROC lpProc );
WINUSERAPI int WINAPI GetDeviceNumber();
WINUSERAPI int WINAPI EnumDevice( int);
// CD Device Operate function below
WINUSERAPI int WINAPI USBCDReset( int ID );
WINUSERAPI int WINAPI USBCDMoveto( int ID, int Index );
WINUSERAPI int WINAPI USBCDGetCDDown( int ID );
WINUSERAPI int WINAPI USBCDLEDON( int ID );
WINUSERAPI int WINAPI USBCDLEDOFF( int ID );
WINUSERAPI int WINAPI USBCDGetStatus( int ID );
}
#endif
now for the regular functions to transform them to use in c# its
/////////////////////////////////////
using System.Runtime.InteropServices;
[DllImport("USBCDDLL.dll")]
private static extern void InitUSBCDLibrary();
//////////////////////////////////////////////
not very difficult, right. But how would I use the "callback" thingie?
please any code example would be very helpfull.
thx