initialise 0 Newbie Poster

Hi,

I'm hoping someone can help! I'm writing a sign language tutor that displays a video of someone signing and then expects the user to record themselves performing the same sign. The program works perfectly when run through Visual C++ 2008 Express Edition. However, if the .exe file is run from the Release folder the program works except that whilst recording the window freezes so that one cannot see any movement being made. But it does record the movement, it just isn't appearing on screen (verified by playing back the clip). The window says not responding and the hour glass icon appears.

Here is my capture code. I hope it's not too long to post here:

HRESULT Capture::StartCapture()
{
	hr = intCaptureGraphBuilder2();

	//sets the file name where the recorded video will be stored - Asf is the media type
	hr = pCaptureGraph2->SetOutputFileName(&MEDIASUBTYPE_Asf, L"D:\\MyVideo.ASF", &pASFWriter, &pSink);

	hr = pCaptureGraph2->GetFiltergraph(&pGraphBuilder);

	hr = QueryIMediaControl();

	if(FAILED(hr))
	{
		CoUninitialize();
	}

	hr = GetAudioInputFilter(&pAudioInputFilter);

	if(SUCCEEDED(hr))
	{
		hr = pGraphBuilder->AddFilter(pAudioInputFilter, L"Audio capture");
	}

	hr = GetVideoInputFilter(&pVideoInputFilter);

	if(SUCCEEDED(hr))
	{
		hr = pGraphBuilder->AddFilter(pVideoInputFilter, L"Video capture");
	}

	hr = pCaptureGraph2->RenderStream(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video, pVideoInputFilter, NULL,NULL); 


	hr = pCaptureGraph2->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video, pVideoInputFilter, NULL,pASFWriter); 


	hr = pCaptureGraph2->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Audio, pAudioInputFilter, NULL,pASFWriter); 

	if(SUCCEEDED(hr))
	{
		hr = pMediaControl->Run();
	}

	wait(10);

	hr = pMediaControl->Stop();

	pSink->Release(); 
	pASFWriter->Release(); 
	pVideoInputFilter->Release(), 
	pAudioInputFilter->Release(); 
	pMediaControl->Release(); 
	pGraphBuilder->Release(); 
	pCaptureGraph2->Release(); 
	
return hr;
}

Thanks in advance