Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: conversion from hex to Readable format Pin
Chandrasekharan P13-Dec-07 0:35
Chandrasekharan P13-Dec-07 0:35 
GeneralRe: conversion from hex to Readable format Pin
CPallini13-Dec-07 0:58
mveCPallini13-Dec-07 0:58 
GeneralRe: conversion from hex to Readable format Pin
Chandrasekharan P13-Dec-07 1:22
Chandrasekharan P13-Dec-07 1:22 
GeneralYou're welcome Pin
CPallini13-Dec-07 1:55
mveCPallini13-Dec-07 1:55 
GeneralConvert char* to CString Pin
rajanponnalagu12-Dec-07 23:39
rajanponnalagu12-Dec-07 23:39 
GeneralRe: Convert char* to CString Pin
Sunil Shindekar12-Dec-07 23:51
Sunil Shindekar12-Dec-07 23:51 
GeneralRe: Convert char* to CString Pin
rajanponnalagu13-Dec-07 0:08
rajanponnalagu13-Dec-07 0:08 
GeneralRe: Convert char* to CString Pin
CPallini13-Dec-07 0:11
mveCPallini13-Dec-07 0:11 
Sunil Shindekar wrote:
_base = m_userName.GetBuffer


The above is a mistake, because, unless you want to lock the CString internal buffer forever, then you have to call ReleaseBuffer method, afterwards the _base pointer becomes garbage, please read documentation http://msdn2.microsoft.com/en-us/library/kt26tkzx(VS.71).aspx[^].


Sunil Shindekar wrote:
_base = new char[]
strcpy(_base, m_userName.getbuffer)


Better, but still mistakes. You don't need at all GetBuffer, to do this (and you aren't calling ReleaseBuffer afterwards), the LPCTSTR cast operator is enough.
Furthermore you don't specify character array size.
And, finally, you're supposing that it is an ANSI build.

Is It enough?

Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.


GeneralRe: Convert char* to CString Pin
CPallini13-Dec-07 0:29
mveCPallini13-Dec-07 0:29 
GeneralRe: Convert char* to CString Pin
KarstenK13-Dec-07 2:20
mveKarstenK13-Dec-07 2:20 
GeneralTemp folder path Pin
neha.agarwal2712-Dec-07 23:11
neha.agarwal2712-Dec-07 23:11 
GeneralRe: Temp folder path Pin
toxcct12-Dec-07 23:24
toxcct12-Dec-07 23:24 
GeneralRe: Temp folder path Pin
ThatsAlok12-Dec-07 23:36
ThatsAlok12-Dec-07 23:36 
GeneralRe: Temp folder path Pin
Johpoke13-Dec-07 0:55
Johpoke13-Dec-07 0:55 
QuestionHow to get text from a text box control pertaining to cursor position Pin
AmarjeetSinghMatharu12-Dec-07 22:52
AmarjeetSinghMatharu12-Dec-07 22:52 
AnswerRe: How to get text from a text box control pertaining to cursor position Pin
Nelek13-Dec-07 0:46
protectorNelek13-Dec-07 0:46 
GeneralBad handshake in machine<-->PC communication Pin
__yash__12-Dec-07 21:49
professional__yash__12-Dec-07 21:49 
GeneralRe: Bad handshake in machine<-->PC communication Pin
David Crow13-Dec-07 4:23
David Crow13-Dec-07 4:23 
GeneralDifference in OS Pin
Chandrasekharan P12-Dec-07 21:22
Chandrasekharan P12-Dec-07 21:22 
AnswerRe: Difference in OS Pin
CPallini12-Dec-07 21:49
mveCPallini12-Dec-07 21:49 
GeneralRe: Difference in OS Pin
Chandrasekharan P12-Dec-07 22:00
Chandrasekharan P12-Dec-07 22:00 
GeneralRe: Difference in OS Pin
CPallini12-Dec-07 22:08
mveCPallini12-Dec-07 22:08 
GeneralRe: Difference in OS Pin
Chandrasekharan P12-Dec-07 22:16
Chandrasekharan P12-Dec-07 22:16 
GeneralYou're welcome Pin
CPallini12-Dec-07 22:25
mveCPallini12-Dec-07 22:25 
GeneralDeny "Create File" Permission to a User Pin
narayanagvs12-Dec-07 20:10
narayanagvs12-Dec-07 20:10 

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.