Credential Provider using opencv

I am working with credential provider using opencv. Display face logon before windows logon, for this wrote code in credential provider using opencv. I can display the window but i cant display the webcam in the window.
I wrote code like this in commanwindow.cpp in _initinstance():
cvNamedWindow("Window", CV_WINDOW_AUTOSIZE);
IplImage *frame;
// If the camera hasn't been initialized, then open it.
if (!camera) {
camera = cvCaptureFromCAM(0);
if (!camera) {
// Try to set the camera resolution
cvSetCaptureProperty( camera, CV_CAP_PROP_FRAME_WIDTH, 360);//640);
cvSetCaptureProperty( camera, CV_CAP_PROP_FRAME_HEIGHT, 240);//'//480);
// Wait a little, so that the camera can auto-adjust itself
Sleep(500); // (in milliseconds)
frame = cvQueryFrame( camera ); // get the first frame, to make sure the camera is initialized.
frame = cvQueryFrame( camera );
cvShowImage("Window", camImg);

This is the code i wrote, can anyone give me where i am going wrong.
Topic archived. No new replies allowed.