|
-
August 17th, 2005, 02:40 AM
#1
Programm exits right after start
MFC dialog-based programm exits with code 0 right after start. I don`t even see the dialog itself appear. The thing is that it worked okay before I reinstalled Windows and now it doesn`t even start under Visual in debug mode (not to mention the release version)
What`s the problem?
-
August 17th, 2005, 02:43 AM
#2
Re: Programm exits right after start
most likelly it is missing some of its dependencies: ActiveX, DLL, COM etc
Har Har
-
August 17th, 2005, 02:50 AM
#3
Re: Programm exits right after start
It doesn`t use any external dlls or ActiveX stuff.
-
August 17th, 2005, 03:02 AM
#4
Re: Programm exits right after start
Did you re-install Visual Studio?
Requests such as
"I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.
-
August 17th, 2005, 03:03 AM
#5
Re: Programm exits right after start
MFC dialog-based programm exits with code 0 right after start. I don`t even see the dialog itself appear
Does the output from the debugger give you any information as to how far the process went? Have you tried putting breakpoints in different parts e.g InitInstance
-
August 17th, 2005, 03:05 AM
#6
Re: Programm exits right after start
Yeah, I uninstalled everything, installed Windows (the same) over the last one, and reinstalled most of the software including VS
-
August 17th, 2005, 03:28 AM
#7
Re: Programm exits right after start
 Originally Posted by m8m
MFC dialog-based programm exits with code 0 right after start. I don`t even see the dialog itself appear. The thing is that it worked okay before I reinstalled Windows and now it doesn`t even start under Visual in debug mode (not to mention the release version)
What`s the problem?
In case of ActiveXControl Some time we have to Initialize them by
InitCommonControls() with specified option r u doing those thing.
second did u register your control.
did u specified all the header file in proper manner etc
these can be some common reason
have alook on this
-
August 17th, 2005, 04:11 AM
#8
Re: Programm exits right after start
 Originally Posted by m8m
It doesn`t use any external dlls or ActiveX stuff.
Have you tried debugging and see where does your app breaks?
Har Har
-
August 17th, 2005, 04:26 AM
#9
Re: Programm exits right after start
For some reason the programm can`t be debugged. It misses some kind of debug information, so I can`t use breakpoints and stuff like that to trace where the programm exits. Maybe it is because of that app was originally written in old VC++ and then converted to new one in VS .NET 6.0
And it doesn`t break, it just exits with code 0. I don`t really know, but I think it is the way app NORMALLY exit. Like if you clicked the red cross 8((
-
August 17th, 2005, 04:28 AM
#10
Re: Programm exits right after start
I had this once too. Did you add a rich edit control to your dialog?
-
August 17th, 2005, 04:33 AM
#11
Re: Programm exits right after start
No RichEdit. But I have progressbar, combos, radios, checksbuttons, tree, buttons and usual edits.
What was the problem with RichEdit?
-
August 17th, 2005, 04:40 AM
#12
Re: Programm exits right after start
well, my application also closed with exit code 0. When researching, I found out I had to call AfxInitRichEdit();
After that, it worked perfect. Maybe you can show us the code of your InitInstance (of the application).
-
August 17th, 2005, 04:44 AM
#13
Re: Programm exits right after start
BOOL CNewApp::InitInstance()
{
InitCommonControls();
CWinApp::InitInstance();
AfxEnableControlContainer();
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
//Enable3dControlsStatic(); // Call this when linking to MFC statically
CNewDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
//return TRUE;
}
Well, this is it.
-
August 17th, 2005, 04:46 AM
#14
Re: Programm exits right after start
and can you show us the code of the OnInitDialog function of the CNewDlg dialog?
-
August 17th, 2005, 04:54 AM
#15
Re: Programm exits right after start
BOOL CNewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
/*
m_Tree.Initialize();
GetChirp();
GetLast();
*/
return TRUE; // return TRUE unless you set the focus to a control
}
The commented out functions are mine, they don`t affect exiting or not exiting of app.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|