#define CDECLCALL_CONV __cdecl typedef void (CDECLCALL_CONV *ConnectedCB) (DPHandle hdl); BPS_DP_API unsigned long CDECLCALL_CONV getDPDevices(DPHandle devices[], unsigned long* count);
private void connected(ref DocProcHandle hdl) { // this code works fine } <--- it crashes here after it leaves my callback method and before anything else in the c# application runs
public struct DPcbs { public uint size; public IntPtr connectedCB; ... more callbacks }
m_c = new ConnectedCB(connected); m_p = Marshal.GetFunctionPointerForDelegate(m_c); m_events.connectedCB = m_p;