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

C / C++ / MFC

 
QuestionDialog - waiting while control is populated Pin
tiresias225-Sep-08 2:50
tiresias225-Sep-08 2:50 
AnswerRe: Dialog - waiting while control is populated Pin
Graham Bradshaw25-Sep-08 3:06
Graham Bradshaw25-Sep-08 3:06 
AnswerRe: Dialog - waiting while control is populated Pin
Michael Dunn25-Sep-08 12:31
sitebuilderMichael Dunn25-Sep-08 12:31 
GeneralRe: Dialog - waiting while control is populated Pin
tiresias226-Sep-08 3:03
tiresias226-Sep-08 3:03 
GeneralRe: Dialog - waiting while control is populated Pin
tiresias229-Sep-08 3:32
tiresias229-Sep-08 3:32 
Questiontypelib issue -- GetRecordInfoFromGuids Pin
George_George25-Sep-08 2:35
George_George25-Sep-08 2:35 
QuestionConnecting to SQL Server Express Database Pin
Ali Tavakol25-Sep-08 2:23
Ali Tavakol25-Sep-08 2:23 
QuestionHow to write char buffer to ostream Pin
CodingLover25-Sep-08 2:11
CodingLover25-Sep-08 2:11 
Hi all,

I want to write a buffer content into a ostream. So I try this.

<br />
int CopyBufferTo(ostream& str;)<br />
{<br />
char writeBuffer[100] = {0};<br />
// Do the processing on buffer<br />
str.write(writeBuffer, 200);<br />
<br />
return 0;<br />
}<br />


Is that fine. I print the stream to console, and I can see the expect output. But then I want to attach as follows,

int AttachTo()<br />
{<br />
stringstream str(ios::in|ios::out|ios::binary);<br />
if(CopyBufferTo(str) == 0)<br />
{<br />
char test[256] = {0};<br />
sprintf(test, "%s", str.str());<br />
memcpy(400, buffer, 200);<br />
}<br />
}


I hope it's clear to you, after attaching the stream to buffer it contain part of it. Not the output on console. Can you help me to find where I'm going wrong.

Thanks

I appreciate your help all the time...
CodingLover Smile | :)

AnswerRe: How to write char buffer to ostream Pin
David Crow25-Sep-08 3:55
David Crow25-Sep-08 3:55 
QuestionIs MFC obsolete? Pin
Christian Flutcher25-Sep-08 2:01
Christian Flutcher25-Sep-08 2:01 
AnswerRe: Is MFC obsolete? Pin
toxcct25-Sep-08 2:14
toxcct25-Sep-08 2:14 
GeneralRe: Is MFC obsolete? Pin
CPallini4-Aug-09 11:39
mveCPallini4-Aug-09 11:39 
AnswerRe: Is MFC obsolete? PinPopular
Rajesh R Subramanian25-Sep-08 2:41
professionalRajesh R Subramanian25-Sep-08 2:41 
GeneralRe: Is MFC obsolete? Pin
Michael Schubert25-Sep-08 2:55
Michael Schubert25-Sep-08 2:55 
GeneralRe: Is MFC obsolete? Pin
Rajesh R Subramanian25-Sep-08 3:03
professionalRajesh R Subramanian25-Sep-08 3:03 
GeneralRe: Is MFC obsolete? Pin
Christian Flutcher25-Sep-08 3:01
Christian Flutcher25-Sep-08 3:01 
GeneralRe: Is MFC obsolete? Pin
Rajesh R Subramanian25-Sep-08 3:13
professionalRajesh R Subramanian25-Sep-08 3:13 
GeneralRe: Is MFC obsolete? Pin
Christian Flutcher25-Sep-08 3:15
Christian Flutcher25-Sep-08 3:15 
GeneralRe: Is MFC obsolete? [modified] Pin
SandipG 25-Sep-08 5:22
SandipG 25-Sep-08 5:22 
GeneralRe: Is MFC obsolete? Pin
Mark Salsbery25-Sep-08 5:42
Mark Salsbery25-Sep-08 5:42 
GeneralRe: Is MFC obsolete? Pin
Naveen25-Sep-08 17:30
Naveen25-Sep-08 17:30 
GeneralRe: Is MFC obsolete? Pin
ThatsAlok25-Sep-08 19:58
ThatsAlok25-Sep-08 19:58 
GeneralRe: Is MFC obsolete? Pin
Rajesh R Subramanian25-Sep-08 20:46
professionalRajesh R Subramanian25-Sep-08 20:46 
GeneralRe: Is MFC obsolete? Pin
ThatsAlok25-Sep-08 23:13
ThatsAlok25-Sep-08 23:13 
GeneralRe: Is MFC obsolete? Pin
Rajesh R Subramanian25-Sep-08 23:18
professionalRajesh R Subramanian25-Sep-08 23:18 

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.