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

C / C++ / MFC

 
JokeRe: static member initialization order fiasco Pin
toxcct21-Jun-06 23:52
toxcct21-Jun-06 23:52 
GeneralRe: static member initialization order fiasco Pin
Tnarol22-Jun-06 1:06
Tnarol22-Jun-06 1:06 
GeneralRe: static member initialization order fiasco Pin
Cedric Moonen22-Jun-06 1:48
Cedric Moonen22-Jun-06 1:48 
GeneralRe: static member initialization order fiasco Pin
Tnarol22-Jun-06 1:57
Tnarol22-Jun-06 1:57 
AnswerRe: static member initialization order fiasco Pin
Weiye Chen22-Jun-06 0:18
Weiye Chen22-Jun-06 0:18 
GeneralRe: static member initialization order fiasco Pin
toxcct22-Jun-06 0:39
toxcct22-Jun-06 0:39 
GeneralRe: static member initialization order fiasco Pin
Tnarol22-Jun-06 1:09
Tnarol22-Jun-06 1:09 
AnswerRe: static member initialization order fiasco Pin
Ryan Binns22-Jun-06 1:39
Ryan Binns22-Jun-06 1:39 
You could put the constant in an anonymous namespace at the top of your implementation file, rather than in the class. You could also have GetConfigFile() set the file name if it hasn't been set, and always call it, rather than use the filename directly - that way it would always be initialised before it was used

Cedric is right though. Since your class contains state, it is better implemented as a singleton, rather than a bunch of static methods and a static data member.


Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: static member initialization order fiasco Pin
Tnarol22-Jun-06 2:08
Tnarol22-Jun-06 2:08 
GeneralRe: static member initialization order fiasco Pin
Ryan Binns22-Jun-06 2:14
Ryan Binns22-Jun-06 2:14 
QuestionHow play a file in two windows in DirectShow? Pin
zhangssan2221-Jun-06 22:47
zhangssan2221-Jun-06 22:47 
AnswerRe: How play a file in two windows in DirectShow? [modified] Pin
Justin Tay22-Jun-06 0:55
Justin Tay22-Jun-06 0:55 
QuestionHelp: Initialize function for CFrameWnd Pin
Sarath C21-Jun-06 22:36
Sarath C21-Jun-06 22:36 
AnswerRe: Help: Initialize function for CFrameWnd Pin
FarPointer21-Jun-06 22:48
FarPointer21-Jun-06 22:48 
GeneralRe: Help: Initialize function for CFrameWnd Pin
Sarath C21-Jun-06 22:52
Sarath C21-Jun-06 22:52 
AnswerRe: Help: Initialize function for CFrameWnd Pin
Weiye Chen21-Jun-06 22:50
Weiye Chen21-Jun-06 22:50 
QuestionDialog Active in Background Pin
goosegg21-Jun-06 22:09
goosegg21-Jun-06 22:09 
AnswerRe: Dialog Active in Background Pin
_AnsHUMAN_ 21-Jun-06 22:17
_AnsHUMAN_ 21-Jun-06 22:17 
GeneralRe: Dialog Active in Background Pin
goosegg21-Jun-06 22:37
goosegg21-Jun-06 22:37 
GeneralRe: Dialog Active in Background Pin
Sarath C21-Jun-06 22:45
Sarath C21-Jun-06 22:45 
GeneralRe: Dialog Active in Background Pin
Weiye Chen21-Jun-06 22:57
Weiye Chen21-Jun-06 22:57 
AnswerRe: Dialog Active in Background Pin
Sarath C21-Jun-06 22:49
Sarath C21-Jun-06 22:49 
GeneralThanks. Re: Dialog Active in Background Pin
goosegg22-Jun-06 0:06
goosegg22-Jun-06 0:06 
QuestionGetting ip of client using winsock Pin
darkcloud.42o21-Jun-06 21:55
darkcloud.42o21-Jun-06 21:55 
AnswerRe: Getting ip of client using winsock Pin
_AnsHUMAN_ 21-Jun-06 22:07
_AnsHUMAN_ 21-Jun-06 22:07 

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.