Click here to Skip to main content
16,017,502 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HDC and CStatic control question Pin
Ryan Binns1-Jun-05 18:25
Ryan Binns1-Jun-05 18:25 
GeneralRe: HDC and CStatic control question Pin
Steve Messer13-Jun-05 20:38
Steve Messer13-Jun-05 20:38 
Generalworking with binary files in C++ Pin
knapak1-Jun-05 5:55
knapak1-Jun-05 5:55 
GeneralRe: working with binary files in C++ Pin
David Crow1-Jun-05 7:07
David Crow1-Jun-05 7:07 
GeneralRe: working with binary files in C++ Pin
knapak1-Jun-05 8:21
knapak1-Jun-05 8:21 
GeneralRe: working with binary files in C++ Pin
S. Senthil Kumar1-Jun-05 8:33
S. Senthil Kumar1-Jun-05 8:33 
GeneralRe: working with binary files in C++ Pin
knapak1-Jun-05 9:23
knapak1-Jun-05 9:23 
GeneralRe: working with binary files in C++ Pin
S. Senthil Kumar2-Jun-05 1:15
S. Senthil Kumar2-Jun-05 1:15 
Writing out a std::map is not a good idea. It internally uses pointers and dynamically allocated memory, so writing the map will only write out the pointers and not their values. For eg
class Test
{
public:
   int *p;
};

int main()
{
   Test test;
   test.p = new int();
   *(test.p) = 100;
}

Writing out test to a file will write out p, which is just a address (and which will change for every program run). Because you're reading it back in the same program, you're alteast able to read back the values. Try reading the file after shutting down the program that wrote to it, you'll find that iteration itself crashes.

I'd suggest writing out the values to file, manually and then reading them back, (again manually).

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: working with binary files in C++ Pin
knapak2-Jun-05 11:48
knapak2-Jun-05 11:48 
Generalusing library in different solution Pin
_indra_m1-Jun-05 5:49
_indra_m1-Jun-05 5:49 
GeneralMultiple files Pin
Andrew Admire1-Jun-05 4:35
Andrew Admire1-Jun-05 4:35 
GeneralRe: Multiple files Pin
M.Mehrdad.M1-Jun-05 5:48
M.Mehrdad.M1-Jun-05 5:48 
GeneralRe: Multiple files Pin
Andrew Admire1-Jun-05 6:32
Andrew Admire1-Jun-05 6:32 
GeneralRe: Multiple files Pin
David Crow1-Jun-05 7:32
David Crow1-Jun-05 7:32 
GeneralRe: Multiple files Pin
Andrew Admire1-Jun-05 8:07
Andrew Admire1-Jun-05 8:07 
GeneralRe: Multiple files Pin
David Crow1-Jun-05 8:16
David Crow1-Jun-05 8:16 
GeneralRe: Multiple files Pin
S. Senthil Kumar1-Jun-05 8:36
S. Senthil Kumar1-Jun-05 8:36 
GeneralRe: Multiple files Pin
Andrew Admire1-Jun-05 9:49
Andrew Admire1-Jun-05 9:49 
GeneralIE plugin Pin
Tender_Nail1-Jun-05 3:52
Tender_Nail1-Jun-05 3:52 
GeneralRe: IE plugin Pin
ThatsAlok1-Jun-05 18:20
ThatsAlok1-Jun-05 18:20 
GeneralSupported file types in DirectShow Pin
mssg1-Jun-05 2:37
mssg1-Jun-05 2:37 
GeneralRe: Supported file types in DirectShow Pin
Momotte1-Jun-05 2:41
Momotte1-Jun-05 2:41 
QuestionWhat happened to my CString? Pin
IlanTal1-Jun-05 1:50
IlanTal1-Jun-05 1:50 
GeneralMicrosoft Visual C++ Code Library: "Buffer Overrun" (link.exe) Pin
MahatmaG1-Jun-05 1:50
MahatmaG1-Jun-05 1:50 
GeneralHiding a CPropertyPage at runtime Pin
tabor251-Jun-05 1:45
tabor251-Jun-05 1: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.