Hello,
I am trying to integrate some OpenCV functionality into my application. Currently I have code set up with DirectShow to get a video feed from my camera, which is then showed in an MFC window. This code cannot be changed or removed.
The code runs completely fine, but regardless of the location i place the following line of code:
IplImage *img = cvLoadImage("C:/well.jpg");
The webcam fails to initialize correctly and breaks the program.
more directly, i get a FAILED HRESULT at:
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)
More specifically, at some point in my code i Call CDialog::doModal(), which then hits CoInitializeEx(), and thus makes the program fail.
would anyone know what is going on here?