Link to home
Start Free TrialLog in
Avatar of imperialguy
imperialguyFlag for United States of America

asked on

Error Code: 0xc0150002 - Unable to run a program written in VC++ on any visual studio platform !!

I am using OpenCV libraries to write a small program to find the edge of an image. I configured the visual studio completely as directed by OpenCV website. The program has compiled with 0 errors. But when I try to run it, it gives me the following error message:

Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application

I tried the same program on VS2005, VS.net 2003 and VS 2008. All of them compile the program without any errors but give the same error message. Surprisingly the code compiles and also runs on a different system in our lab.

The OS on my system is WinXP SP3 (Build 2600).
#include "stdafx.h"
#include "cxtypes.h"
#include "cv.h"
#include "highgui.h"
#include "cvaux.h"
#include "cxmisc.h"
 
void main()
{
 
		IplImage *originalImage = cvLoadImage("D:\\Blurry_Detection\\Fujinon\\mayo_test_video\\2.EP\\clear_image\\01378.jpg",-1);
		IplImage *grayScaleImage = cvCreateImage(cvSize(701,468),8,1);
		IplImage *edgeImage = cvCreateImage(cvSize(701,468), 8, 1);
		cvCvtColor(originalImage, grayScaleImage, CV_BGR2GRAY);
		cvSobel(grayScaleImage, edgeImage, 1, 0, 1);
		cvNamedWindow("EdgeImage",1);
		cvShowImage("EdgeImage", edgeImage);
		cvWaitKey();
		cvDestroyWindow("EdgeImage");
		//cvSaveImage(".\\Resultant.jpg",grayScaleImage);
		cvReleaseImage(&originalImage);
		cvReleaseImage(&grayScaleImage);
		cvReleaseImage(&edgeImage);
 
}

Open in new window

Avatar of APaskiewicz
APaskiewicz

Avatar of imperialguy

ASKER

.NET Framework Version 2.0 SP2 is already installed on my system. When I am trying to uninstall it in order to re-install .NET Framework Version 2.0, I get an error message saying that I cannot uninstall .net framework v2.0 SP2 because other applications are dependent on it. I am attaching a screen shot of different .net frameworks that got installed when I installed my Windows XP SP3. I am also attaching a screen shot of what happens when I try to remove .net framework 2.0 SP2 in order to install .net framework 2.0.
installed-frameworks.JPG
unable-to-unistall-.net2.0-SP2.JPG
See if this tool will help you>
Removal tool to fix .NET Framework install failures:
http://blogs.msdn.com/astebner/archive/2005/04/08/406671.aspx
See if this tool will help you>
Removal tool to fix .NET Framework install failures:
http://blogs.msdn.com/astebner/archive/2005/04/08/406671.aspx
ASKER CERTIFIED SOLUTION
Avatar of imperialguy
imperialguy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of phoffric
Just taking a WAG at what could have caused the previous install of the vc++ 2005 redistributable not to work well with your application - possibly, on the previous installation, there may have been some application running (or service) that caused the installation to almost be correct. Just a guess.