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

C / C++ / MFC

 
GeneralRe: why are junk char appended while writing CString to CFile Pin
krmed13-Mar-08 5:27
krmed13-Mar-08 5:27 
GeneralRe: why are junk char appended while writing CString to CFile Pin
David Crow13-Mar-08 5:44
David Crow13-Mar-08 5:44 
GeneralRe: why are junk char appended while writing CString to CFile Pin
krmed13-Mar-08 6:15
krmed13-Mar-08 6:15 
GeneralRe: why are junk char appended while writing CString to CFile Pin
David Crow13-Mar-08 7:49
David Crow13-Mar-08 7:49 
GeneralRe: why are junk char appended while writing CString to CFile Pin
Stephen Hewitt13-Mar-08 14:45
Stephen Hewitt13-Mar-08 14:45 
GeneralRe: why are junk char appended while writing CString to CFile Pin
krmed14-Mar-08 0:37
krmed14-Mar-08 0:37 
GeneralRe: why are junk char appended while writing CString to CFile Pin
Stephen Hewitt16-Mar-08 12:58
Stephen Hewitt16-Mar-08 12:58 
GeneralRe: why are junk char appended while writing CString to CFile Pin
krmed17-Mar-08 0:35
krmed17-Mar-08 0:35 
Well, the code I posted does what the OP was looking for - there isn't more code needed. He simply was writing the string to a file.

As for release buffer, MSDN says
If you use the pointer returned by GetBuffer to change the string contents, you must call ReleaseBuffer before using any other CSimpleStringT member methods.


However, in his case, the contents were not changed, thus the call to ReleaseBuffer is not required.

Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

GeneralRe: why are junk char appended while writing CString to CFile Pin
Stephen Hewitt17-Mar-08 13:11
Stephen Hewitt17-Mar-08 13:11 
GeneralRe: why are junk char appended while writing CString to CFile Pin
David Crow13-Mar-08 7:48
David Crow13-Mar-08 7:48 
GeneralRe: why are junk char appended while writing CString to CFile Pin
CPallini13-Mar-08 3:59
mveCPallini13-Mar-08 3:59 
GeneralRe: why are junk char appended while writing CString to CFile Pin
ptr_Electron13-Mar-08 4:08
ptr_Electron13-Mar-08 4:08 
GeneralRe: why are junk char appended while writing CString to CFile Pin
CPallini13-Mar-08 4:21
mveCPallini13-Mar-08 4:21 
GeneralRe: why are junk char appended while writing CString to CFile Pin
Rajkumar R13-Mar-08 4:22
Rajkumar R13-Mar-08 4:22 
GeneralRe: why are junk char appended while writing CString to CFile Pin
ptr_Electron13-Mar-08 4:26
ptr_Electron13-Mar-08 4:26 
GeneralRe: why are junk char appended while writing CString to CFile Pin
Rajkumar R13-Mar-08 4:39
Rajkumar R13-Mar-08 4:39 
GeneralRe: why are junk char appended while writing CString to CFile Pin
Chris Meech13-Mar-08 4:25
Chris Meech13-Mar-08 4:25 
GeneralRe: why are junk char appended while writing CString to CFile Pin
ptr_Electron13-Mar-08 4:36
ptr_Electron13-Mar-08 4:36 
GeneralRe: why are junk char appended while writing CString to CFile Pin
Mark Salsbery13-Mar-08 6:58
Mark Salsbery13-Mar-08 6:58 
Questionneed help in source code to find data in database Pin
ieyra20413-Mar-08 3:13
ieyra20413-Mar-08 3:13 
GeneralRe: need help in source code to find data in database Pin
David Crow13-Mar-08 3:17
David Crow13-Mar-08 3:17 
GeneralRe: need help in source code to find data in database Pin
CPallini13-Mar-08 3:36
mveCPallini13-Mar-08 3:36 
GeneralPlz Help!!! Pin
dheka13-Mar-08 3:06
dheka13-Mar-08 3:06 
GeneralRe: Plz Help!!! Pin
Rajesh R Subramanian13-Mar-08 3:10
professionalRajesh R Subramanian13-Mar-08 3:10 
GeneralRe: Plz Help!!! [OT] Pin
Rajkumar R13-Mar-08 3:25
Rajkumar R13-Mar-08 3:25 

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.