I am using OpenCV 2.4.6 with Visual Studio 2010. I have a problem in video capturing. Program has no errors, no warnings. Build solution ok. But when I start debugging the program, it executes and Camera on and automatically off and also Command Prompt automatically off. I am not getting any result. But Image processing and others program execution ok. Can anyone help me about it?