public VfwCameraDevice(int index, int width, int height, int fps, int windowStyle, IntPtr parentWindow) : base(index, width, height, fps, windowStyle, parentWindow) { // Setup the delegate functions that will be called fVideoStreamDelegate = StreamCallBack; fVideoFrameDelegate = FrameCallBack; fControlDelegate = ControlCallback; fErrorDelegate = ErrorCallback; SetCallbackOnVideoStream(fVideoStreamDelegate); SetCallbackOnFrame(fVideoFrameDelegate); SetCallbackOnCapControl(fControlDelegate); SetCallbackOnStatus(fStatusDelegate); SetCallbackOnError(fErrorDelegate); }
static extern int SendCallbackMessage([In] IntPtr hWnd, int wMsg, uint wParam, VfwcapErrorCallback lParam);
public bool SetCallbackOnError(VfwcapErrorCallback fpProc) { bool success = 1 == SendCallbackMessage(fWindowHandle, Vfw.WM_CAP_SET_CALLBACK_ERROR, 0, fpProc); return success; }