Credential Provider using opencv

Hi,
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);
while(1)
{
IplImage *frame;
// If the camera hasn't been initialized, then open it.
if (!camera) {
camera = cvCaptureFromCAM(0);
if (!camera) {
exit(1);
}
// 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);
cvWaitKey(0);
}