CamTest2 DeviceIoControl returns FALSE

Feb 7, 2011 at 6:33 AM

Hello Everyone,

I am new to this discussion board and new to WinCe programming. I am currently developing a WinCe 6.0 application and am trying to integrate the WebCam driver into it. I am using the CamTest2 application to see how it all works.

Initially I had an error "The driver reports no format supported or an error getting formats. Error code = 5", from the InitInstance in CamTest2.cpp. I resolved this by replacing VIDFORMAT_MJPEG with VIDFORMAT_UNCOMPRESSED.

The CamTest2 application then appeared to be working but I am getting no images what so ever, after going through the debugger I found that in CameraCode.cpp there is a function, ReadFrameThread, which is calling f = DeviceIoControl (pcs->hCam, IOCTL_CAMERA_DEVICE_STARTVIDEOSTREAM, (LPVOID)&svStruct, sizeof (STARTVIDSTRUCT), 0, 0, &dwBytes, NULL);

DeviceIoControl is returning FALSE. Any ideas why it would be doing this? Is it because this application may only be capable of using MJPEG format and not Uncompressed and resolving my initial error is causing this new one? Please note that the system is not generating any visual errors, its just blank, except for when I try to Get Still Image, in which case it is displaying "Error capturing still. Error 31"

Any help would be greatly appreciated.

Thanks and best regards,