my DLLImport prototype [DllImport("PikaAPI.dll")] unsafe public static extern int PK_DSP_PORT_SetEventHandler(uint TResourceHandle, void* PK_VOID, EventHandlerCB EventHandler); //My Callback delegate unsafe public delegate void EventHandlerCB(void* vpUserData, uint uiEvent, uint uiParam0, uint uiParam1); //Set event handler on the voice card //Set Tone Detection EventHanderl if((PK_DSP_PORT_SetEventHandler(hMemberToneDetectInput, (void*)hMemberToneDetectInput, EvetHandler2)) != PK_SUCCESS) { } else { } //Event handler for all callbacks...... unsafe public static void EventHandler (void* vpUserData, uint uiEvent, uint uiParam0, uint uiParam1) { lock(EvQ) { EvQ[iQIn].uiUserData = (uint)vpUserData; EvQ[iQIn].uiEvent = uiEvent; EvQ[iQIn].uiParam0 = uiParam0; EvQ[iQIn].uiParam1 = uiParam1; } //Do Stuff here //Reset Event Queue to control size iQIn++ if(iQIn == 200) iQIn = 0; }