Visual C++ MFC application crashed when buttons clicked.

I have created a program called “Test.exe” created using Visual C++ 6.0 Professional. The program is a simple dialog MFC application, uses the serial port (MSCOMM) and is a debug build.
The program has been reliable for several years but only runs on a PC that has Visual C++ installed on it.
The program will crash when I click on any of the application's button on all other machines (ones without Visual C++ 6.0).
The program will run on a PC that has had Visual C++ installed on it and then removed.
“Dependency walker”
I have tried Microsoft Visual C++ 6 Professional’s dependency walker.
I copied the files that the “dependency walker” stated were needed on to the failing PC.
The application continues to crash as described.
I installed “Vcredist.exe” on to the failing PC.  
The application continues to crash as described.

What is needed for my program to work (other than installing Visual C++)?
I suspect the MSCOMM control or other OCX dependency. How would I resolve?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


I think best is to make a Release build in order to use it on computers where VC++ isn't installed - then you could either decide to use 'vcredist' to install needed DLLs on the target machine or you could even create a build which statically links to MFC so no DLLs are needed at all, only the resulting EXE.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndyAinscowFreelance programmer / ConsultantCommented:
>>The program will crash when I click on any of the  application's button on all other machines (ones without Visual C++  6.0).

You should be distributing a release build (as previously said).  
You will find you are not allowed to distribute the debug versions of the MFC dll's with your app if you check your licence agreement.

I note however that your comment indicates your app actually runs on other machines - so you must already be distributing a release build (or a debug build with the debug versions of the dll's).

Does the crash happen for each button or just for one or two buttons ?
Do you get any error message ?
AndyAinscowFreelance programmer / ConsultantCommented:
Yes, but the removal should also remove the (debug) dll's
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

AndyAinscowFreelance programmer / ConsultantCommented:
>>The Test  MFC application has encountered a problem and needs to close.  We are sorry for the inconvenience

For completeness and to make certain I understand the situation correctly.
Your app will start on the other machine, you see the main window.  You then click on ANY button and the message above is shown and the app exits.
AndyAinscowFreelance programmer / ConsultantCommented:
Oh, I hope there is actually more than one button on the dialog (and that these buttons do very diifferent things when clicked - not just call the same function but with a different parameter).
I suggest that you take the time to read me correctly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.