Click here to Skip to main content
15,915,509 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: automatically save a voice file Pin
Alexander M.,24-Jul-05 3:30
Alexander M.,24-Jul-05 3:30 
GeneralWrite Data in the Registry using a Setup-Project Pin
gabriel.fischer23-Jul-05 1:58
gabriel.fischer23-Jul-05 1:58 
Generalsaving value selected in combobox before OK selected Pin
sayup23-Jul-05 0:30
sayup23-Jul-05 0:30 
GeneralRe: saving value selected in combobox before OK selected Pin
Christian Graus23-Jul-05 2:53
protectorChristian Graus23-Jul-05 2:53 
QuestionShowWindow()? Pin
ddmcr22-Jul-05 22:24
ddmcr22-Jul-05 22:24 
AnswerRe: ShowWindow()? Pin
Neelesh K J Jain22-Jul-05 23:07
Neelesh K J Jain22-Jul-05 23:07 
Generalproblem in reding header of dBase iv file Pin
softtec22-Jul-05 22:23
softtec22-Jul-05 22:23 
GeneralGlobal Objects Constructor Pin
Themis22-Jul-05 21:41
Themis22-Jul-05 21:41 
Hi, I 'm experiencing the following problem with global objects. In a program with global objects at the beginning the constructors of these objects are executed and then the program enters in the main function. Everything its ok. Now I doing the following:

<br />
//-- foo.cpp<br />
#include "foo.h"	///< include my header file<br />
<br />
MyClass obj;	///< Global object its constructor should run before main<br />
<br />
//-- MyClass member functions follow<br />
MyClass::MyClass(void)<br />
{<br />
	...<br />
}<br />
...<br />


<br />
//-- main.cpp<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
	//code here<br />
	...<br />
}<br />


If the following code is compiled as one project everything is fine. Now the trick is that I compile foo.cpp as a static library (foo.lib) to which my main program links. Running step by step with the debugger (VS .NET 7.1) I found out that main is called first. Actually placing a breakpoint in my object's constructor I noticed that the constructor is never executed. Why does that happens? If I compile foo.cpp as a dynamic library (dll) will I have the same problem?

Thank you,
Themis
GeneralRe: Global Objects Constructor Pin
Chris Losinger23-Jul-05 2:32
professionalChris Losinger23-Jul-05 2:32 
GeneralRe: Global Objects Constructor Pin
Themis23-Jul-05 5:23
Themis23-Jul-05 5:23 
GeneralRe: Global Objects Constructor Pin
sunit523-Jul-05 6:02
sunit523-Jul-05 6:02 
GeneralRe: Global Objects Constructor Pin
Michael Dunn23-Jul-05 8:06
sitebuilderMichael Dunn23-Jul-05 8:06 
GeneralRich edit. Help needed. Pin
Aqueel22-Jul-05 21:25
Aqueel22-Jul-05 21:25 
GeneralRe: Rich edit. Help needed. Pin
Neelesh K J Jain22-Jul-05 23:10
Neelesh K J Jain22-Jul-05 23:10 
GeneralRe: Rich edit. Help needed. Pin
Michael Dunn23-Jul-05 8:09
sitebuilderMichael Dunn23-Jul-05 8:09 
GeneralVC++/Save Data Pin
agus7522-Jul-05 21:25
agus7522-Jul-05 21:25 
GeneralRe: VC++/Save Data Pin
Christian Graus23-Jul-05 2:54
protectorChristian Graus23-Jul-05 2:54 
GeneralRe: VC++/Save Data Pin
agus7524-Jul-05 11:03
agus7524-Jul-05 11:03 
GeneralRe: VC++/Save Data Pin
Christian Graus24-Jul-05 12:59
protectorChristian Graus24-Jul-05 12:59 
GeneralRe: VC++/Save Data Pin
agus7525-Jul-05 16:05
agus7525-Jul-05 16:05 
GeneralRe: VC++/Save Data Pin
Christian Graus25-Jul-05 16:15
protectorChristian Graus25-Jul-05 16:15 
GeneralKeyboard Hooking Pin
Adeel68822-Jul-05 21:01
Adeel68822-Jul-05 21:01 
GeneralRe: Keyboard Hooking Pin
Alexander M.,24-Jul-05 3:23
Alexander M.,24-Jul-05 3:23 
QuestionHow to set a menu bar into a dialog with child style? Pin
DaveLand22-Jul-05 20:39
DaveLand22-Jul-05 20:39 
GeneralScreen Capture Pin
dSolariuM22-Jul-05 19:20
dSolariuM22-Jul-05 19:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.