Advertisement

04.22.2008 at 11:54AM PDT, ID: 23344123
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

CFileDialog error on close program (This applcation has requested the runtime to terminate...)

Asked by funvill in Windows MFC Programming, Microsoft Visual C++.Net

Tags: , ,

Hello

I have taken over the development of a older utility (+5 years) from anther developer that no longer works for our company. (I am unfamiliar with base code)

I am developing in VS6 with SP6, on Windows vista fully updated.
I am NOT using dot.net

I put a browse button on the main dialog and created a function that invokes a CFileDialog open dialog. My code for the CFileDialog is very standard (included below) and I have used in other programs with out any problems. I do not believe the problem is in my CFileDialog code.

I run the utility and click the button to invoke the CFileDialog select a file and click OK. So far so good no errors. I update the file, save and close it. On close of the program I get the following error message. (I have included a screen shot)

"This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support time for more information.  "

Other things that I have tried
- I restart the utility then click close immediately, No Error
- I restart the utility do some work then close the utility, No Error.
- I comment out the CFileDialog  code and hard code the path to the file push the button. Correct results, No Error.
- The debugger in Visual studios 6 does not seem to catch this error and closes normally after I click OK on the error message.
- I tried to replace the CFileDialog with a GetOpenFileName and I still get the same error.
- I created anther utility that uses the exact same CFileDialog code, ran and closed the utility with no problems.
 
This happens every time I invoke a CFileDialog with this utility.
I have tried cleaning and rebuilding all the source code in release and debug.

I am running out of ideas here, what else should I try?
Suggestions, comments? Start Free Trial
1:
2:
3:
4:
5:
char szFilters[]= "FH Firmware (*.bin)|*.bin|All Files (*.*)|*.*||";
CFileDialog pFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, szFilters, this);
if( pFileDialog.DoModal() == IDOK) {
	m_strPath.Format( "%s", pFileDialog.GetPathName() );
}
Attachments:
 
Error message
Error message
 
 
Keywords: CFileDialog error on close program (T…
 
Loading Advertisement...
 
[+][-]04.22.2008 at 10:11PM PDT, ID: 21417895

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 08:58PM PDT, ID: 21427694

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 01:26PM PDT, ID: 21510747

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows MFC Programming, Microsoft Visual C++.Net
Tags: C++, MFC, VS6, MFC, Error message, runtime error, DLL,
Sign Up Now!
Solution Provided By: funvill
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628