Click here to Skip to main content
15,902,275 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGantt chart component Pin
ppp0019-Nov-05 6:59
ppp0019-Nov-05 6:59 
AnswerRe: Gantt chart component Pin
hint_549-Nov-05 7:31
hint_549-Nov-05 7:31 
AnswerRe: Gantt chart component Pin
David Crow9-Nov-05 8:38
David Crow9-Nov-05 8:38 
QuestionCString concatenation Pin
Kharfax9-Nov-05 6:31
Kharfax9-Nov-05 6:31 
AnswerRe: CString concatenation Pin
Maximilien9-Nov-05 6:47
Maximilien9-Nov-05 6:47 
AnswerRe: CString concatenation Pin
RChin9-Nov-05 6:50
RChin9-Nov-05 6:50 
GeneralRe: CString concatenation Pin
Kharfax9-Nov-05 6:55
Kharfax9-Nov-05 6:55 
AnswerRe: CString concatenation Pin
James R. Twine9-Nov-05 6:57
James R. Twine9-Nov-05 6:57 
Kharfax wrote:
strcat(a.GetBuffer(), b.GetBuffer());


   Never do that!

   What you are doing is appending to a string's internal buffer when you have no idea what that buffer's valid (usable) length is.  For example, if a's internal buffer was 6 characters long, your call to strcat(...) would exceed the length of the buffer and would write the terminating NUL character off of the end of the allocated memory.

   While your problem sounds odd, I would make sure no one accidently #defined "+=" to be "=" (I have seen it done before, do not ask why).  You could also test by adding up to ints in the same way and see if they total correctly.

   Peace!

-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites
(Please rate this post!)
QuestionLoss of "Called by"-functionality Pin
Polly Parrot9-Nov-05 5:02
Polly Parrot9-Nov-05 5:02 
QuestionJava problem in hosted IE view... Pin
James R. Twine9-Nov-05 4:08
James R. Twine9-Nov-05 4:08 
QuestionVC6.0 and VS.NET co-existence question Pin
prcarp9-Nov-05 3:20
prcarp9-Nov-05 3:20 
AnswerRe: VC6.0 and VS.NET co-existence question Pin
John M. Drescher9-Nov-05 3:58
John M. Drescher9-Nov-05 3:58 
QuestionGDI+: Image Save returned Invalid Parameter Pin
raed9-Nov-05 3:13
raed9-Nov-05 3:13 
QuestionMenu items grayed out? Pin
Jesper Knudsen9-Nov-05 2:44
Jesper Knudsen9-Nov-05 2:44 
QuestionRe: Menu items grayed out? Pin
David Crow9-Nov-05 3:05
David Crow9-Nov-05 3:05 
AnswerRe: Menu items grayed out? Pin
Jesper Knudsen9-Nov-05 3:25
Jesper Knudsen9-Nov-05 3:25 
GeneralRe: Menu items grayed out? Pin
David Crow9-Nov-05 3:36
David Crow9-Nov-05 3:36 
GeneralRe: Menu items grayed out? Pin
Jesper Knudsen9-Nov-05 3:55
Jesper Knudsen9-Nov-05 3:55 
GeneralRe: Menu items grayed out? Pin
John M. Drescher9-Nov-05 4:10
John M. Drescher9-Nov-05 4:10 
GeneralRe: Menu items grayed out? Pin
David Crow9-Nov-05 4:13
David Crow9-Nov-05 4:13 
GeneralRe: Menu items grayed out? Pin
Jesper Knudsen9-Nov-05 4:12
Jesper Knudsen9-Nov-05 4:12 
GeneralRe: Menu items grayed out? Pin
David Crow9-Nov-05 5:36
David Crow9-Nov-05 5:36 
QuestionHide the blue task pane in a CHtmlView??? Pin
gleditzsch9-Nov-05 2:35
gleditzsch9-Nov-05 2:35 
AnswerRe: Hide the blue task pane in a CHtmlView??? Pin
Ed K9-Nov-05 7:31
Ed K9-Nov-05 7:31 
GeneralRe: Hide the blue task pane in a CHtmlView??? Pin
gleditzsch9-Nov-05 20:33
gleditzsch9-Nov-05 20:33 

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.