Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to refresh disk content in VMWare ? Pin
vgrigor4-Feb-04 3:17
vgrigor4-Feb-04 3:17 
Generalcontrolling actiions in IE Pin
Abhi Lahare4-Feb-04 3:14
Abhi Lahare4-Feb-04 3:14 
GeneralProblem with static and std::map Pin
inter8ection4-Feb-04 1:42
inter8ection4-Feb-04 1:42 
GeneralRe: Problem with static and std::map Pin
Diddy4-Feb-04 2:03
Diddy4-Feb-04 2:03 
GeneralRe: Problem with static and std::map Pin
inter8ection4-Feb-04 3:34
inter8ection4-Feb-04 3:34 
GeneralRe: Problem with static and std::map Pin
Diddy4-Feb-04 3:44
Diddy4-Feb-04 3:44 
GeneralRe: Problem with static and std::map Pin
inter8ection4-Feb-04 4:01
inter8ection4-Feb-04 4:01 
GeneralRe: Problem with static and std::map Pin
Diddy4-Feb-04 4:07
Diddy4-Feb-04 4:07 
Yes Smile | :) - Maybe Smile | :)

The important bit is "logging object which is being constructed is a global " does this mean that the class that is using the map, which is static, is also being declared as global? Or does it mean the logging class which uses the map is declared global, then you have another "main" class that uses the logging one, which isn't global?

When your app starts up, the C runtime libray will init all your static and global members and doesn't do these in any perticualr order - when your constructor calls insert on the map, it's likley that the map hasn't been created yet.

Comment out the line that insert's into the map into the ctor, put a break point in your classes ctor, when it gets hit, check the call stack and go back to the _inititem functions - this is the CRT calling the ctors for all your global variables. Step back out of your ctor to this loop, and you should see that the loop then go into the ctor for the map - IE the map is being created after your ctor is being called, and you get a AV.

You could have a Init() method on your logging object or something, there are a few soultions to this problem really.
GeneralRe: Problem with static and std::map Pin
inter8ection4-Feb-04 4:40
inter8ection4-Feb-04 4:40 
GeneralRe: Problem with static and std::map Pin
Diddy4-Feb-04 4:47
Diddy4-Feb-04 4:47 
GeneralProblem with Kernel Object Security Pin
particle2k4-Feb-04 1:15
particle2k4-Feb-04 1:15 
GeneralRe: Problem with Kernel Object Security Pin
Alexander M.,4-Feb-04 3:09
Alexander M.,4-Feb-04 3:09 
GeneralRe: Problem with Kernel Object Security Pin
particle2k4-Feb-04 3:31
particle2k4-Feb-04 3:31 
GeneralMultithreading in C++ Pin
TV4-Feb-04 0:11
TV4-Feb-04 0:11 
GeneralRe: Multithreading in C++ Pin
Diddy4-Feb-04 2:11
Diddy4-Feb-04 2:11 
GeneralRe: Multithreading in C++ Pin
TV4-Feb-04 3:58
TV4-Feb-04 3:58 
GeneralRe: Multithreading in C++ Pin
Diddy4-Feb-04 4:30
Diddy4-Feb-04 4:30 
QuestionHow do i get handle to window in IE Pin
User 2155973-Feb-04 23:41
User 2155973-Feb-04 23:41 
AnswerRe: How do i get handle to window in IE Pin
Amr Abdel-Mohsen4-Feb-04 9:20
Amr Abdel-Mohsen4-Feb-04 9:20 
Generalprinting a html file Pin
Member 5281553-Feb-04 22:53
Member 5281553-Feb-04 22:53 
GeneralRe: printing a html file Pin
Anonymous4-Feb-04 11:22
Anonymous4-Feb-04 11:22 
Generalsingleton problem Pin
yccheok3-Feb-04 22:19
yccheok3-Feb-04 22:19 
GeneralRe: singleton problem Pin
Cristian Teodorescu3-Feb-04 23:01
Cristian Teodorescu3-Feb-04 23:01 
QuestionWhy slower draws on Screen with HW Accel. set to FULL? Pin
uus993-Feb-04 21:46
uus993-Feb-04 21:46 
Generallib/dll file question Pin
bryce3-Feb-04 21:45
bryce3-Feb-04 21:45 

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.