Click to See Complete Forum and Search --> : who know "First-chance exception in hello.exe(NTDLL.dll):0xc0000008:Invalid Handle."?
InternationScape
April 26th, 2006, 09:20 PM
my program create multi process and wait process to work, then debug,
pop up this message.
when i run this program in release mode, somtimes crash.
what's the problem?
philkr
April 28th, 2006, 03:43 AM
As somebody said once in another thread: "My crystal ball is broken today". Please post some code!
MrViggy
April 28th, 2006, 01:43 PM
The problem is that you have an invalid handle somewhere, that is being used.
Without code, I cannot comment further.
Viggy
macx
July 9th, 2006, 12:59 PM
I have got the same kind of error either when I close a dialog box or the program itself: " first-chance exception NTDLL.DLL 0xC0000008: Invalid Handle"
My code for closing the dialog box is this
void CWEdit::OnEditOK()
{
CEseoDlg Eseo_edit;
Eseo_edit.LoadInitialConditions();
AfxMessageBox("test");
CDialog::OnOK();
}
And I have noticed that if I remove the class definition (so.. the first two lines of the OnEditOk code) I wont get that problem... so it may be related to that but I don't see how. Any help would be great!!!!
MrViggy
July 10th, 2006, 03:10 PM
What is a 'CEseoDlg'? Is this some dialog? What does 'LoadInitialConditions()' do? You do realize that once "CWEdit::OnEditOK()", 'Eseo_edit' is invalid.
Viggy
zerver
July 11th, 2006, 07:25 AM
You most likely have a problem in the CEseoDlg constructor or the LoadInitialConditions function.
macx
July 12th, 2006, 03:38 PM
Hi,
I'll start with Viggy's questions:
- "What is a 'CEseoDlg'? "
CEseoDlg is a class for a dialog box.. it is one of those classes Visual Studio automatically creates when we make a new project. (I regret I did this way now... but it's too late to go back.. so I'll try to find the error at any cost). For better understandig this is a dialog based application I'm working on. So it is basically the most important class.
- "Is this some dialog?"
YES... as I said before and as you just have guessed ;)
- "What does 'LoadInitialConditions()' do?"
Ok, this function will basically set some values for the program initialization. The user does this, could I say, in a "child-dialog-box" where he inputs these initial conditions. So ou can better understand whats happening here... When the user clicks the "OK" button after insering the initial conditions this function should correctly update these inputs. Oh, by the way the error only happens in debug mode... in release mode everything goes smoothly. But anyway I should track this error.
- " You do realize that once "CWEdit::OnEditOK()", 'Eseo_edit' is invalid."
I'm sorry but I did not understand you with this... maybe I'm missing something important here.
------------------------------------------
"ou most likely have a problem in the CEseoDlg constructor or the LoadInitialConditions function."
This is the constructor... some problem with it?
CEseoDlg::CEseoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CEseoDlg::IDD, pParent)
{
m_play = false;
//{{AFX_DATA_INIT(CEseoDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDI_MAINFRAME);
}
and I don't think its the LoadInitialConditions function problem because I extracted all the code from it and I got the same error...
It is for sure the class definition that is making this error.. but how?!?
MrViggy
July 12th, 2006, 04:28 PM
- " You do realize that once "CWEdit::OnEditOK()", 'Eseo_edit' is invalid."
I'm sorry but I did not understand you with this... maybe I'm missing something important here.
'Eseo_edit' is allocated on the stack and in the scope of "CWEdit::OnEditOK()" only. Once "CWEdit::OnEditOK()" returns, Eseo_edit will be destroyed, but it's probably not being destroyed properly. Hence the exception.
Viggy
macx
July 12th, 2006, 05:13 PM
Hey,
thanks for the quick reply.
I have checked the problem right now. I don't need to expressly update the data because it's being updated "automatically" when CDialog::OnOK(); is executed. So I was doing a double update.
For me this post is over
macx
July 12th, 2006, 05:25 PM
ups... to early to say that the post is done!
I had this error before but I never gave much attention to it. Its the same kind of error: "First-chance exception in Eseo.exe (NTDLL.dll):0xc0000008:Invalid Handle".. this happens when I close the program in debug mode.
What could this be?!
MrViggy
July 12th, 2006, 05:34 PM
You're using an invalid handle. Something that you had a handle to was destroyed, and you are trying to use it after it was destroyed. You'll have to step through your code in the debugger.
Viggy
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.