Click here to Skip to main content
15,898,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: cstring to tchar conversion Pin
Rajesh R Subramanian4-Feb-08 22:08
professionalRajesh R Subramanian4-Feb-08 22:08 
GeneralRe: cstring to tchar conversion Pin
CPallini4-Feb-08 22:18
mveCPallini4-Feb-08 22:18 
GeneralRe: cstring to tchar conversion Pin
Rajesh R Subramanian4-Feb-08 22:25
professionalRajesh R Subramanian4-Feb-08 22:25 
GeneralRe: cstring to tchar conversion Pin
CPallini4-Feb-08 22:36
mveCPallini4-Feb-08 22:36 
GeneralRe: cstring to tchar conversion Pin
Rajkumar R4-Feb-08 23:11
Rajkumar R4-Feb-08 23:11 
GeneralRe: cstring to tchar conversion Pin
Rajesh R Subramanian4-Feb-08 23:19
professionalRajesh R Subramanian4-Feb-08 23:19 
GeneralRe: cstring to tchar conversion Pin
Rajkumar R5-Feb-08 7:00
Rajkumar R5-Feb-08 7:00 
GeneralRe: cstring to tchar conversion Pin
Rajesh R Subramanian5-Feb-08 19:54
professionalRajesh R Subramanian5-Feb-08 19:54 
Rajkumar R wrote:
this is not for ur info and to mispell it, the similarity i meant here is, if the person is forgetting to write ReleaseBuffer, the same can happen in delete, and also between CreateFile-CloseHandle, GetDC-ReleaseDC, lock-unlock, ..


But then the point here is that GetBuffer() is a member function and so people may just call it like that, while they'd generally know that new and delete, etc., go as pairs. But, they may not know it's the case with GetBuffer(). See here[^] for an example. It is up to the programmer to write good quality code, but then someone who's asking how to extract the string out of a CString will definitely need some assistance in writing good quality code. So, I'd always explain the tradeoffs while using something like GetBuffer().


Rajkumar R wrote:
ignorance and carelessness will always leads to bugs. I don't think this argument is supportive.


Again, if I feel that someone may do it in an ignorant way, rather than just providing an answer which may lead him to do somethign in a wrong way, I'd try to correct him when I am answering his query.


Rajkumar R wrote:
if you meant that getbuffer is making copy FYI it does return pointer without any copy unless


Do you even think that I wouldn't know this? This shows that you didn't even understand what I was talking about.


Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP

GeneralRe: cstring to tchar conversion Pin
Rajkumar R5-Feb-08 20:40
Rajkumar R5-Feb-08 20:40 
GeneralRe: cstring to tchar conversion Pin
Rajesh R Subramanian5-Feb-08 21:14
professionalRajesh R Subramanian5-Feb-08 21:14 
GeneralRe: cstring to tchar conversion Pin
CPallini4-Feb-08 22:15
mveCPallini4-Feb-08 22:15 
GeneralRe: cstring to tchar conversion Pin
Rajkumar R4-Feb-08 23:07
Rajkumar R4-Feb-08 23:07 
GeneralRe: cstring to tchar conversion Pin
CPallini4-Feb-08 23:19
mveCPallini4-Feb-08 23:19 
GeneralRe: cstring to tchar conversion Pin
Rajkumar R4-Feb-08 23:23
Rajkumar R4-Feb-08 23:23 
JokeRe: cstring to tchar conversion Pin
CPallini5-Feb-08 0:00
mveCPallini5-Feb-08 0:00 
GeneralRe: cstring to tchar conversion Pin
Rajkumar R5-Feb-08 0:06
Rajkumar R5-Feb-08 0:06 
GeneralRe: cstring to tchar conversion Pin
CPallini5-Feb-08 0:18
mveCPallini5-Feb-08 0:18 
JokeRe: cstring to tchar conversion Pin
Rajkumar R5-Feb-08 18:39
Rajkumar R5-Feb-08 18:39 
GeneralRe: cstring to tchar conversion Pin
CPallini5-Feb-08 20:50
mveCPallini5-Feb-08 20:50 
AnswerRe: cstring to tchar conversion Pin
Rajkumar R4-Feb-08 21:08
Rajkumar R4-Feb-08 21:08 
GeneralRe: cstring to tchar conversion Pin
Francis K Antony4-Feb-08 23:11
Francis K Antony4-Feb-08 23:11 
QuestionRe: cstring to tchar conversion Pin
Rajkumar R4-Feb-08 23:27
Rajkumar R4-Feb-08 23:27 
GeneralRe: cstring to tchar conversion Pin
Francis K Antony4-Feb-08 23:48
Francis K Antony4-Feb-08 23:48 
QuestionRe: cstring to tchar conversion Pin
Rajkumar R4-Feb-08 23:58
Rajkumar R4-Feb-08 23:58 
GeneralRe: cstring to tchar conversion Pin
Cedric Moonen4-Feb-08 21:13
Cedric Moonen4-Feb-08 21:13 

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.