Click here to Skip to main content
15,905,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Very interesting Question about Compilers Pin
Joel Holdsworth18-Mar-03 10:45
Joel Holdsworth18-Mar-03 10:45 
GeneralRe: Very interesting Question about Compilers Pin
Neville Franks18-Mar-03 10:55
Neville Franks18-Mar-03 10:55 
GeneralRe: Very interesting Question about Compilers Pin
Joel Holdsworth18-Mar-03 11:26
Joel Holdsworth18-Mar-03 11:26 
GeneralRe: Very interesting Question about Compilers Pin
Neville Franks18-Mar-03 12:29
Neville Franks18-Mar-03 12:29 
GeneralON_THREAD_MESSAGE Pin
clintsinger18-Mar-03 9:20
clintsinger18-Mar-03 9:20 
GeneralRe: ON_THREAD_MESSAGE Pin
Dave Bryant18-Mar-03 9:38
Dave Bryant18-Mar-03 9:38 
QuestionWell, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Joan M18-Mar-03 9:10
professionalJoan M18-Mar-03 9:10 
AnswerRe: Well, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Dave Bryant18-Mar-03 9:33
Dave Bryant18-Mar-03 9:33 
The LPCTSTR operator on the CString returns a constant string - you should never cast it to non-const string to change it. So while the first example will compile, and possibly work (depending on what Arxiu.Write() does), it is bad practice, and could cause problems.

You only need to call ReleaseBuffer() after a call to GetBuffer() to tell the CString to take control over the buffer again (and allowing you to call other methods).

Dave
AnswerRe: Well, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Tim Smith18-Mar-03 9:34
Tim Smith18-Mar-03 9:34 
GeneralRe: Well, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Joan M20-Mar-03 5:05
professionalJoan M20-Mar-03 5:05 
GeneralATL Object Wizard Pin
DuFF18-Mar-03 8:59
DuFF18-Mar-03 8:59 
GeneralCombine multiple images into one Pin
AWebDude18-Mar-03 8:59
AWebDude18-Mar-03 8:59 
GeneralRe: Combine multiple images into one Pin
Maximilien18-Mar-03 9:07
Maximilien18-Mar-03 9:07 
GeneralRe: Combine multiple images into one Pin
AWebDude18-Mar-03 9:34
AWebDude18-Mar-03 9:34 
GeneralRe: Combine multiple images into one Pin
Larry Antram18-Mar-03 10:05
Larry Antram18-Mar-03 10:05 
GeneralSort Pin
Anthony988718-Mar-03 7:16
Anthony988718-Mar-03 7:16 
GeneralRe: Sort Pin
valikac18-Mar-03 8:49
valikac18-Mar-03 8:49 
GeneralRe: Sort Pin
Chris Meech18-Mar-03 8:57
Chris Meech18-Mar-03 8:57 
GeneralHelp! Pin
Dennis L18-Mar-03 6:59
Dennis L18-Mar-03 6:59 
GeneralRe: Help! Pin
AlexO18-Mar-03 7:39
AlexO18-Mar-03 7:39 
GeneralRe: Help! Pin
Anonymous18-Mar-03 9:20
Anonymous18-Mar-03 9:20 
GeneralRe: Help! Pin
AlexO18-Mar-03 10:29
AlexO18-Mar-03 10:29 
GeneralRe: Help! Pin
Anonymous18-Mar-03 9:21
Anonymous18-Mar-03 9:21 
GeneralShell Namespace Pin
Ana Lucia18-Mar-03 6:41
Ana Lucia18-Mar-03 6:41 
Generalchanging an int to a _variant_t Pin
Chris Eatough18-Mar-03 6:20
Chris Eatough18-Mar-03 6:20 

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.