Click here to Skip to main content
15,910,878 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Native c++ using VC++ 8.0 Pin
Saurabh.Garg17-Jun-08 2:35
Saurabh.Garg17-Jun-08 2:35 
GeneralRe: Native c++ using VC++ 8.0 Pin
malaugh17-Jun-08 11:43
malaugh17-Jun-08 11:43 
GeneralRe: Native c++ using VC++ 8.0 Pin
Saurabh.Garg17-Jun-08 19:43
Saurabh.Garg17-Jun-08 19:43 
QuestionProblem Reading/Writing text/dat files Pin
Trupti Mehta16-Jun-08 21:52
Trupti Mehta16-Jun-08 21:52 
AnswerRe: Problem Reading/Writing text/dat files Pin
Mark Salsbery17-Jun-08 6:24
Mark Salsbery17-Jun-08 6:24 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta17-Jun-08 7:52
Trupti Mehta17-Jun-08 7:52 
GeneralRe: Problem Reading/Writing text/dat files Pin
Mark Salsbery17-Jun-08 8:16
Mark Salsbery17-Jun-08 8:16 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta17-Jun-08 22:28
Trupti Mehta17-Jun-08 22:28 
Oh Thaks Mark, this helped me get rid of the Assertion Errors/Exceptions. But still my condition hasn't improved, its in almost same place.

I store 2 objs in a map & send it to write.
newOperMap.SetAt(1, OperatorDetails(1, _T("One")));
newOperMap.SetAt(2, OperatorDetails(2, _T("Two")));
db.WriteOperators(newOperMap);

Write method
		for (POSITION pos = opdtMap.GetStartPosition(); pos != NULL;) {
			int key;
			OperatorDetails od;
			opdtMap.GetNextAssoc(pos, key, od ); 
//			ar.WriteObject(&od);
			ar << &od;
		}

Executes for loop 2 times, od has respectives values i.e. "Two" followed by "One".

In my text file, I can see only "Two":
   ÿÿ
  OperatorDetails   Two 


While Reading:
    OperatorDetails* od;

for (int i=0; i < count; i++) {
    OperatorDetails odObj;
    ar >> od;
    if (od == NULL)
        break;

    odObj.SetOperatorNo(od->GetOperatorNo());
    odObj.SetOperName(od->GetOperName());
    operMap->SetAt(odObj.GetOperatorNo(), odObj);
}
    delete od;

For loop executes twice as count is stored as 2 records while writing. Both the times it gets only "Two". So number of records actually retrieved are only 1 as the key is the same 2. While writing though &od has the proper object 2nd time i.e. 1 One, still it doesn't write only. ar << &od is also executing properly, still somehow something is acting weird.

Can you help me figure out that improper stuff. Would be glad enough & able to take a relaxed breath.

Thanks

Terry

GeneralRe: Problem Reading/Writing text/dat files Pin
Mark Salsbery18-Jun-08 6:13
Mark Salsbery18-Jun-08 6:13 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta18-Jun-08 22:57
Trupti Mehta18-Jun-08 22:57 
GeneralRe: Problem Reading/Writing text/dat files Pin
Mark Salsbery18-Jun-08 9:12
Mark Salsbery18-Jun-08 9:12 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta18-Jun-08 22:44
Trupti Mehta18-Jun-08 22:44 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta19-Jun-08 0:15
Trupti Mehta19-Jun-08 0:15 
GeneralRe: Problem Reading/Writing text/dat files Pin
Mark Salsbery19-Jun-08 6:04
Mark Salsbery19-Jun-08 6:04 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta19-Jun-08 22:38
Trupti Mehta19-Jun-08 22:38 
AnswerRe: Problem Reading/Writing text/dat files Pin
ThatsAlok17-Jun-08 16:45
ThatsAlok17-Jun-08 16:45 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta17-Jun-08 22:33
Trupti Mehta17-Jun-08 22:33 
GeneralRe: Problem Reading/Writing text/dat files Pin
ThatsAlok18-Jun-08 5:15
ThatsAlok18-Jun-08 5:15 
GeneralRe: Problem Reading/Writing text/dat files Pin
Trupti Mehta18-Jun-08 22:48
Trupti Mehta18-Jun-08 22:48 
Questiona error about c++ read xml Pin
huke198716-Jun-08 21:31
huke198716-Jun-08 21:31 
GeneralRe: a error about c++ read xml Pin
huke198716-Jun-08 22:01
huke198716-Jun-08 22:01 
GeneralRe: a error about c++ read xml Pin
ThatsAlok17-Jun-08 20:55
ThatsAlok17-Jun-08 20:55 
AnswerRe: a error about c++ read xml Pin
Naveen16-Jun-08 22:37
Naveen16-Jun-08 22:37 
GeneralRe: a error about c++ read xml Pin
huke198716-Jun-08 22:58
huke198716-Jun-08 22:58 
GeneralRe: a error about c++ read xml Pin
Naveen16-Jun-08 23:11
Naveen16-Jun-08 23:11 

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.