Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Event handler for double click in CListCtrl Pin
EXTEIDE9-Feb-06 14:35
EXTEIDE9-Feb-06 14:35 
AnswerRe: Event handler for double click in CListCtrl Pin
Shog99-Feb-06 14:48
sitebuilderShog99-Feb-06 14:48 
QuestionHow to let VS 6.0 to compile unicode resource file? Pin
transoft9-Feb-06 14:04
transoft9-Feb-06 14:04 
AnswerRe: How to let VS 6.0 to compile unicode resource file? Pin
EXTEIDE9-Feb-06 14:42
EXTEIDE9-Feb-06 14:42 
GeneralRe: How to let VS 6.0 to compile unicode resource file? Pin
transoft10-Feb-06 6:15
transoft10-Feb-06 6:15 
QuestionCode snippets for C++ in VS 8? Pin
gosh9-Feb-06 14:01
gosh9-Feb-06 14:01 
AnswerRe: Code snippets for C++ in VS 8? Pin
S Douglas9-Feb-06 18:43
professionalS Douglas9-Feb-06 18:43 
QuestionReinitializing a strstream Pin
PJ Arends9-Feb-06 13:45
professionalPJ Arends9-Feb-06 13:45 
I am a great fan of MFC's CString class, especially it's Format member function. Makes things so easy. But I now have a problem that requires me to use a strstream buffer in a loop. How do I go about reinitializing the strstream so that I write to the beginning of the buffer at each loop iteration. This code does not work, the string in the stream does not change at all after the first iteration (stays at "%%1")
ostrstream stream;
for (x = 1; x < 10; ++x)
{
   stream.seekp(0);
   stream << "%%" << x << ends;
...
}
This code however does work
for (x = 1; x < 10; ++x)
   ostrstream stream;
   stream << "%%" << x << ends;
...
}
Recreating the strstream in each loop iteration seems like a silly way to get this to work.



"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

"Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04

"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05

Within you lies the power for good - Use it!
AnswerRe: Reinitializing a strstream Pin
_anil_9-Feb-06 14:07
_anil_9-Feb-06 14:07 
GeneralRe: Reinitializing a strstream Pin
PJ Arends9-Feb-06 14:20
professionalPJ Arends9-Feb-06 14:20 
GeneralRe: Reinitializing a strstream Pin
_anil_9-Feb-06 14:35
_anil_9-Feb-06 14:35 
GeneralRe: Reinitializing a strstream Pin
PJ Arends9-Feb-06 15:00
professionalPJ Arends9-Feb-06 15:00 
GeneralRe: Reinitializing a strstream Pin
_anil_9-Feb-06 15:34
_anil_9-Feb-06 15:34 
GeneralRe: Reinitializing a strstream Pin
PJ Arends9-Feb-06 15:42
professionalPJ Arends9-Feb-06 15:42 
GeneralRe: Reinitializing a strstream Pin
_anil_9-Feb-06 15:56
_anil_9-Feb-06 15:56 
GeneralRe: Reinitializing a strstream Pin
PJ Arends9-Feb-06 16:15
professionalPJ Arends9-Feb-06 16:15 
GeneralGot it! Pin
PJ Arends9-Feb-06 15:53
professionalPJ Arends9-Feb-06 15:53 
AnswerRe: Reinitializing a strstream Pin
Bernhard9-Feb-06 19:51
Bernhard9-Feb-06 19:51 
QuestionHELP NEEDED HERE. PLEASE ANYONE!!!! Pin
jermzypeter9-Feb-06 13:00
jermzypeter9-Feb-06 13:00 
AnswerRe: HELP NEEDED HERE. PLEASE ANYONE!!!! Pin
George L. Jackson9-Feb-06 13:12
George L. Jackson9-Feb-06 13:12 
GeneralRe: HELP NEEDED HERE. PLEASE ANYONE!!!! Pin
jermzypeter9-Feb-06 13:18
jermzypeter9-Feb-06 13:18 
GeneralRe: HELP NEEDED HERE. PLEASE ANYONE!!!! Pin
George L. Jackson9-Feb-06 13:25
George L. Jackson9-Feb-06 13:25 
GeneralRe: HELP NEEDED HERE. PLEASE ANYONE!!!! Pin
jermzypeter9-Feb-06 13:33
jermzypeter9-Feb-06 13:33 
GeneralRe: HELP NEEDED HERE. PLEASE ANYONE!!!! Pin
Lord Kixdemp9-Feb-06 13:37
Lord Kixdemp9-Feb-06 13:37 
GeneralRe: HELP NEEDED HERE. PLEASE ANYONE!!!! Pin
George L. Jackson9-Feb-06 13:44
George L. Jackson9-Feb-06 13:44 

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.