There is a function in the camera class
bool Camera::CaptureFrame(bool rotate){ Rotated = rotate; return capGrabFrame(CaptureWindow); } An appropriate callback is tied to the capGrabFrame api call. The problem is that if you simply pull the USB camera out of the port, the application freezes and crashes, because, as I understand it, the camera driver that is on the CaptureWindow is lost from the list of devices. And it is necessary that the application does not crash, but fix the error and report it to the user.
The question is how to properly catch driver access errors? There is in vfw.h LRESULT CALLBACK capErrorCallback(HWND hWnd, int nID, LPCTSTR lpsz); , but I don’t understand what kind of error id it requires to enter, if I haven’t received any error yet, and will this callback help solve the problem?
try/catchor__try/__except. Consider that the crash in the API is unlikely, first look for it in yourself. - mega