I can\'t seem to figure out how to do this, I have searched on google and found two code examples, one from a github screen capture library and another on a posting group and ne
I don't know what it is, but the minute I ask a question, I get obssesed with finding the answer. Anyway, part of this issue is actually solved by the answer to this question:
OpenCV 2.0 C++ API using imshow: returns unhandled exception and "bad-flag"
In Visual C++:
go to Project->Properties (or Alt-F7) Configuration Properties->Linker->Input->Additional Dependencies
replace the usual " cv210.lib cxcore210.lib highgui210.lib" by " cv210d.lib cxcore210d.lib highgui210d.lib" - which are the debugging libraries.
highgui still shows grey and doesn't work, but reading from the HBITMAP using the above method now works. and I don't really need highgui, it was just for testing anyway.