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

Posted on 2009-02-18
Last Modified: 2013-11-26
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, 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);


		cvShowImage("EdgeImage", edgeImage);








Open in new window

Question by:imperialguy
    LVL 1

    Expert Comment


    Author Comment

    .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.
    LVL 27

    Expert Comment

    See if this tool will help you>
    Removal tool to fix .NET Framework install failures:
    See if this tool will help you>
    Removal tool to fix .NET Framework install failures:
    LVL 27

    Expert Comment


    Accepted Solution

    installing microsoft vc++ 2005 redistributable has solved the problem.
    LVL 31

    Expert Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    Query datatable in LINQ 6 27
    C# - SOLID Question 6 35
    Need help error handling a windows service 2 25
    DataGridView 2 11
    If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article ( first and run the tool TDSSKiller ( to get rid of the infection. Once done, and if the …
    We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now