Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple includes Pin
Tim Craig31-Aug-10 8:59
Tim Craig31-Aug-10 8:59 
GeneralRe: Multiple includes Pin
Aescleal31-Aug-10 9:13
Aescleal31-Aug-10 9:13 
GeneralRe: Multiple includes Pin
Paul Michalik31-Aug-10 12:35
Paul Michalik31-Aug-10 12:35 
GeneralRe: Multiple includes Pin
Tim Craig31-Aug-10 13:12
Tim Craig31-Aug-10 13:12 
GeneralRe: Multiple includes Pin
Paul Michalik31-Aug-10 21:29
Paul Michalik31-Aug-10 21:29 
GeneralRe: Multiple includes [modified] Pin
Paul Michalik31-Aug-10 6:28
Paul Michalik31-Aug-10 6:28 
GeneralRe: Multiple includes Pin
Shy Agam31-Aug-10 21:27
Shy Agam31-Aug-10 21:27 
GeneralRe: Multiple includes Pin
Paul Michalik31-Aug-10 23:57
Paul Michalik31-Aug-10 23:57 
Well, there are several "dangers" in that, but don't panic! It's a perfectly legal c++ construct - which can be used in safe manner if:

1. the functionality of your program does not depend on the time when the global objects are initialized/deinitialized
2. the globals do not depend on the state of each other in an undefined manner
3. you can assure that these global objects are initialized at all - speaking in terms of the holy standard "they are used in the program".

With regards to point 3: Under certain circumstances, linkers do not include these globals into the program, if they don't see an explicit usage of them. This behavior collides with many popular idioms such as pluggable factories, reflectors or serializers: Here, the framework relies on dynamic initialization (this is a process which runs before your program starts) of static class objects with non-trivial constructors which perform certain functionality on instantiation - e.g. register a factory method for a type in an another global collection of factory methods.
GeneralRe: Multiple includes Pin
Shy Agam1-Sep-10 2:13
Shy Agam1-Sep-10 2:13 
QuestionIs there any difference in drawing emf on CDC and Bitmap? Pin
Sameerkumar Namdeo29-Aug-10 21:46
Sameerkumar Namdeo29-Aug-10 21:46 
Questionhow to find memory leaks in attached dll Pin
ganesh.dp29-Aug-10 20:02
ganesh.dp29-Aug-10 20:02 
AnswerRe: how to find memory leaks in attached dll Pin
Eugen Podsypalnikov29-Aug-10 20:18
Eugen Podsypalnikov29-Aug-10 20:18 
AnswerRe: how to find memory leaks in attached dll PinPopular
Niklas L29-Aug-10 20:41
Niklas L29-Aug-10 20:41 
AnswerRe: how to find memory leaks in attached dll Pin
ThatsAlok29-Aug-10 20:54
ThatsAlok29-Aug-10 20:54 
AnswerRe: how to find memory leaks in attached dll Pin
rp_suman30-Aug-10 4:14
rp_suman30-Aug-10 4:14 
QuestionBlackBerry IMEI Number Pin
MsmVc29-Aug-10 18:55
MsmVc29-Aug-10 18:55 
AnswerRe: BlackBerry IMEI Number Pin
ThatsAlok29-Aug-10 23:19
ThatsAlok29-Aug-10 23:19 
GeneralRe: BlackBerry IMEI Number Pin
MsmVc29-Aug-10 23:21
MsmVc29-Aug-10 23:21 
GeneralRe: BlackBerry IMEI Number Pin
sayonee30-Aug-10 1:30
sayonee30-Aug-10 1:30 
GeneralRe: BlackBerry IMEI Number Pin
MsmVc30-Aug-10 1:34
MsmVc30-Aug-10 1:34 
GeneralRe: BlackBerry IMEI Number Pin
enhzflep30-Aug-10 16:24
enhzflep30-Aug-10 16:24 
QuestionHooking OleGetClipboard Pin
Member 382162029-Aug-10 10:28
Member 382162029-Aug-10 10:28 
AnswerRe: Hooking OleGetClipboard Pin
Code-o-mat29-Aug-10 22:12
Code-o-mat29-Aug-10 22:12 
GeneralRe: Hooking OleGetClipboard Pin
Member 382162030-Aug-10 0:19
Member 382162030-Aug-10 0:19 
GeneralRe: Hooking OleGetClipboard Pin
Code-o-mat30-Aug-10 0:38
Code-o-mat30-Aug-10 0:38 

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.