Solved

CFileDialog returns -1 for thread

Posted on 1997-11-13
7
240 Views
Last Modified: 2013-11-19
I noticed, in a larger application, that after bringing up the CFileDialog box (Open mode) and dismissing it properly (i.e. it returns w/ IDOK) I get the message "The thread 0xFFF8D963 has exited with code -1 (0xFFFFFFFF)." I made a test program that just puts up the CFileDialog and nothing else and it has the same problem. Right after selecting a file and clicking OK the above message is printed in the debug frame. What I would like to do is get rid of this error. I think it's throwing off another element of my program.

I'm running MFC C++ DevStudio 5.0 on Windows 95.

Thanks
0
Comment
Question by:winkle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1309916
This is not an error. When you debug a program and the debugger detects that a thread has terminated, it will output this message with the thread exit code. The file open dialog box creates another thread which will be terminated once you close the dialog box.
0
 

Author Comment

by:winkle
ID: 1309917
I didn't intend to imply that I considered the entire thread exit message an error. I understand that the thread messages are information and not an error. It's the -1 return as opposed to the 0 return that I'm asking about. In otherwords, why does the closing of a file dialog generate "The thread 0xFFF8D963 has exited with code -1..." instead of "The thread 0xFFF8D963 has exited with code 0...", for example. Is there a way to reset this? I've double checked my constructor call for the CFileDialog  and in my test case that's the only thing I'm doing. Here's the code:

  CFileDialog aDlg (TRUE, "htm", "*.htm",
                    OFN_PATHMUSTEXIST | OFN_NOREADONLYRETURN,
                 "HTML Files (*.htm)|*.htm|All Files *.*)|*.*||",
                    this);

0
 
LVL 23

Expert Comment

by:chensu
ID: 1309918
Sorry, I misunderstood your question. I tried the above code and didn't get the message with Visual C++ 5.0 on Windows 95. Is there anything wrong with your system? Try other system.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Accepted Solution

by:
dirtdart earned 100 total points
ID: 1309919
The way it's supposed to work:  If you click the OK button in the CFileDialog Box, your thread should exit with code -1.  This indicates that a TRUE condition exists, and the code should continue.  If you click the cancel button, it should exit with code 0, thus representing a FALSE condition to show that the user pressed cancel.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1309920
dirtdart:
This sounds correct. But, how come I didn't get the message? Have you tried it?
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1309921
I haven't tried that specific code, but I've written several programs using the same kind of code, and gotten the same results from it.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1309922
I have never gotten the message using not only that specific code  but also the other code I wrote before. It is strange.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 208
sumNumber challenge 16 140
fizzArray  challenge 1 109
Modbus - whats the maximum I can store in one register? 4 81
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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