Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Write a buffer to stringstream Pin
CodingLover28-Sep-08 19:08
CodingLover28-Sep-08 19:08 
GeneralRe: Write a buffer to stringstream Pin
Naveen28-Sep-08 19:26
Naveen28-Sep-08 19:26 
NewsRe: Write a buffer to stringstream Pin
CodingLover28-Sep-08 19:35
CodingLover28-Sep-08 19:35 
GeneralRe: Write a buffer to stringstream Pin
Naveen28-Sep-08 19:54
Naveen28-Sep-08 19:54 
GeneralRe: Write a buffer to stringstream Pin
CodingLover28-Sep-08 20:18
CodingLover28-Sep-08 20:18 
GeneralRe: Write a buffer to stringstream Pin
Naveen28-Sep-08 20:29
Naveen28-Sep-08 20:29 
GeneralRe: Write a buffer to stringstream Pin
CodingLover28-Sep-08 20:36
CodingLover28-Sep-08 20:36 
GeneralRe: Write a buffer to stringstream Pin
Naveen28-Sep-08 21:25
Naveen28-Sep-08 21:25 
CodingLover wrote:
ReadBuffer contains all zeros


All zero?? Then the function dosent worked as expected isnt it...?

CodingLover wrote:
In the WriteBuffer after each character it contain zero


Thats is excatly the problem. That is in the statement sprintf(buff, "%s", temp.c_str()); , the sprintf() function will stop scanning the source string when it encounters a NULL. In your case since the source string is UNICODE, the second byte will be zero and hence the sprintf() returns at that point.

BTW there is another solution for the sprintf to work with unicode strings. used "%S" instead of "%s" in the format specifier.


GeneralRe: Write a buffer to stringstream Pin
CodingLover28-Sep-08 22:44
CodingLover28-Sep-08 22:44 
AnswerRe: Write a buffer to stringstream Pin
followait28-Sep-08 19:18
followait28-Sep-08 19:18 
NewsRe: Write a buffer to stringstream Pin
CodingLover28-Sep-08 19:26
CodingLover28-Sep-08 19:26 
QuestionHow do I find the variable causing the memory leak ? Pin
SherTeks28-Sep-08 18:25
SherTeks28-Sep-08 18:25 
AnswerRe: How do I find the variable causing the memory leak ? Pin
Naveen28-Sep-08 18:59
Naveen28-Sep-08 18:59 
QuestionA sliding container may be Pin
methhoo28-Sep-08 14:45
methhoo28-Sep-08 14:45 
AnswerRe: A sliding container may be Pin
Sarath C28-Sep-08 17:58
Sarath C28-Sep-08 17:58 
GeneralRe: A sliding container may be Pin
santhoshv8428-Sep-08 20:41
santhoshv8428-Sep-08 20:41 
Questioncompiler problem Pin
paullmcnally28-Sep-08 8:28
paullmcnally28-Sep-08 8:28 
AnswerRe: compiler problem Pin
CPallini28-Sep-08 9:49
mveCPallini28-Sep-08 9:49 
QuestionMemory leak when using a dll Pin
Ali Tavakol28-Sep-08 4:40
Ali Tavakol28-Sep-08 4:40 
QuestionRe: Memory leak when using a dll Pin
Mark Salsbery28-Sep-08 9:34
Mark Salsbery28-Sep-08 9:34 
AnswerRe: Memory leak when using a dll Pin
Joe Woodbury28-Sep-08 18:01
professionalJoe Woodbury28-Sep-08 18:01 
GeneralRe: Memory leak when using a dll Pin
Ali Tavakol28-Sep-08 19:37
Ali Tavakol28-Sep-08 19:37 
GeneralRe: Memory leak when using a dll Pin
Joe Woodbury28-Sep-08 20:04
professionalJoe Woodbury28-Sep-08 20:04 
QuestionGdiplus::Font font("Fixedsys",12.f) can't draw the right font Pin
followait28-Sep-08 4:06
followait28-Sep-08 4:06 
AnswerRe: Gdiplus::Font font("Fixedsys",12.f) can't draw the right font Pin
Mark Salsbery28-Sep-08 10:35
Mark Salsbery28-Sep-08 10:35 

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.