public Initialize()
{
CX_OUTPUT_CALLBACK cb = new CX_OUTPUT_CALLBACK(OutDelegateCb);
AureusSDK_Wrapper_VideoCallbackFunSetup.CX_SetOuputCallBack(cb, cnt);
GC.KeepAlive(cb);
}
public static void OutDelegateCb(IntPtr p_aureus_video_output, int num_of_people, IntPtr pObject)
{
}
That would prevent garbage collection from collecting your object. The problem is that you don't havea ny reference (outside of COM) to the "cb" variable. Since garbage collecting is a reference counting operation, when the garbage collector runs it sees the "cb" is not referenced anywhere and garbage collects it.