-
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?
-
Re: Programm exits right after start
most likelly it is missing some of its dependencies: ActiveX, DLL, COM etc
-
Re: Programm exits right after start
It doesn`t use any external dlls or ActiveX stuff.
-
Re: Programm exits right after start
Did you re-install Visual Studio?
-
Re: Programm exits right after start
Quote:
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
-
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
-
Re: Programm exits right after start
Quote:
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
-
Re: Programm exits right after start
Quote:
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?
-
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((
-
Re: Programm exits right after start
I had this once too. Did you add a rich edit control to your dialog?
-
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?
-
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).
-
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.
-
Re: Programm exits right after start
and can you show us the code of the OnInitDialog function of the CNewDlg dialog?
-
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.
-
Re: Programm exits right after start
This looks normal too. If you have not added any activex control or something like that, I cannot explain your problem. I am sorry.
-
Re: Programm exits right after start
also include
comctl32.lib
to your project and then try again.delete your debug and then rebuild your project
-
Re: Programm exits right after start
How do I do that??? 8))
I`m just a newbie after all...
-
Re: Programm exits right after start
Just follow the following step
Click on project-->> Choose Setting-->>Link--->>down side in Object/Library modules
enter
comctl32.lib
and say okay
now rebuild your project
if still problem post your project in form of Zip File
-
Re: Programm exits right after start
Why don't you post the project here as a zip file and see if anyone else can debug it.
-
1 Attachment(s)
Re: Programm exits right after start
That didn`t work either 8((
Anyway, here`s the zip
-
1 Attachment(s)
Re: Programm exits right after start
Quote:
Originally Posted by m8m
That didn`t work either 8((
Anyway, here`s the zip
here is your file there is no error
except multiple decleration of i
i didn't found any other error
check it out
-
Re: Programm exits right after start
After installing Windows, what version of Visual Studio have you installed?
-
Re: Programm exits right after start
Quote:
here is your file there is no error
except multiple decleration of i
i didn't found any other error
check it out
Did it exit on your computer too?
I`ve installed the same version of VS as before: VS .NET 6.0
-
Re: Programm exits right after start
wow, vs .net 6.0. You just developed a new version yourself? What do you mean, vc6 OR vc7 (.net)?
-
Re: Programm exits right after start
There is no such thing as VS. NET 6.0 :D
Your code must have been compiled with a version higher than Visual Studio 6.0 thus it depends on the dll's provided with that version. Make sure you have installed that version. Than, cnelan your project and do a "rebuild all"
-
Re: Programm exits right after start
Okay okay 8))
In about box it identifies itself as
Microsoft Development Environment 2002 Version 7.0
Microsoft .NET Framework 1.0
The 6.0 must have been the old one 8))
Come to think about it, I first had the old VS, started project in it. Then uninstalled it, installed the new VS, converted the project into new one (solution? or whatever) and it worked ok. Having installed new VS on blank windows, found out it doesn`t work anymore.
-
Re: Programm exits right after start
Quote:
Originally Posted by m8m
Okay okay 8))
In about box it identifies itself as
Microsoft Development Environment 2002 Version 7.0
Microsoft .NET Framework 1.0
The 6.0 must have been the old one 8))
Come to think about it, I first had the old VS, started project in it. Then uninstalled it, installed the new VS, converted the project into new one (solution? or whatever) and it worked ok. Having installed new VS on blank windows, found out it doesn`t work anymore.
First Install Visual Studio in proper manner then go ahead and check the error for your project
i given you your project just check it out.that still u r getting error or not.
then go ahead.
there is no error in your project
just take a precaution at the time of declaring variable.okay
every where u can found multiple decleration error in your project
that's all
it's tested on VC6.0
-
Re: Programm exits right after start
Quote:
Originally Posted by humptydumpty
just take a precaution at the time of declaring variable.okay
every where u can found multiple decleration error in your project
that's all
it's tested on VC6.0
Well, actually it is a problem with the VS 6.0 compiler here as it doesn't respect the C++ standard. :D So if he uses the 7.0 or above compiler we will be ok.
-
Re: Programm exits right after start
I noticed that when I try to look at the dialogue resource it gives an error:
"The ActiveX control "{35053A22-8589-11D1-B16A-00C0F0283628}" is not registered on this computer. Register the control and try again"
I`m confused. What ActiveX control?! The most complex controls I use are progressbar and tree. Or are they ActiveX in fact?
And how do I register it?!
-
Re: Programm exits right after start
Quote:
Originally Posted by m8m
I noticed that when I try to look at the dialogue resource it gives an error:
"The ActiveX control "{35053A22-8589-11D1-B16A-00C0F0283628}" is not registered on this computer. Register the control and try again"
ROFLMAO.
Searching on google I found that the Microsoft ImageList Control 6.0 (SP4) has that ID. Perhpas you've added such a control while working in VS 6.0 than forgot all about it when you've migrated to .NET.
-
Re: Programm exits right after start
Imagelist Control? *** is that? 8))
That huge number thing referred to progressbar. After I ripped it off everything works okay. Though it looked cuter with it 8((