Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHeap Error Pin
baerten13-Mar-07 2:37
baerten13-Mar-07 2:37 
AnswerRe: Heap Error Pin
James R. Twine13-Mar-07 2:50
James R. Twine13-Mar-07 2:50 
GeneralRe: Heap Error Pin
baerten13-Mar-07 3:09
baerten13-Mar-07 3:09 
GeneralRe: Heap Error Pin
James R. Twine13-Mar-07 3:16
James R. Twine13-Mar-07 3:16 
GeneralRe: Heap Error Pin
baerten13-Mar-07 4:00
baerten13-Mar-07 4:00 
QuestionRe: Heap Error Pin
prasad_som13-Mar-07 4:08
prasad_som13-Mar-07 4:08 
AnswerRe: Heap Error Pin
baerten13-Mar-07 4:42
baerten13-Mar-07 4:42 
GeneralRe: Heap Error Pin
James R. Twine13-Mar-07 5:03
James R. Twine13-Mar-07 5:03 
   You can just do:
strcpy(temp,str);
   But you should really be using n-versions of the string functions to make sure you do not overrun the temp buffer.

   Note that a CString can be used in place of a const char * or LPCSTR/LPCTSTR, so you generally do not need to copy its contents to a char buffer unless the string data is being used in a non-const fashion.

   Carefully examine any places where you are using CString::GetBuffer(...) - it usually means that something strange is going on.  If you have to use CString::GetBuffer(...), you likely should not be using a CString in that situation (not to mention that calls to it should be wrapped in a try/catch for exception handling).

   Peace!

-=- James
Please rate this message - let me know if I helped or not!<HR>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!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles

AnswerRe: Heap Error Pin
baerten13-Mar-07 23:35
baerten13-Mar-07 23:35 
QuestionAbout System Pin
Tran Ngoc Minh13-Mar-07 2:34
Tran Ngoc Minh13-Mar-07 2:34 
AnswerRe: About System Pin
Hamid_RT13-Mar-07 3:05
Hamid_RT13-Mar-07 3:05 
GeneralVisual Studio 2005 Installation Errors - How to FIx them [modified] Pin
NiceNaidu13-Mar-07 2:16
NiceNaidu13-Mar-07 2:16 
QuestionImages in ListControl Pin
gan_esh13-Mar-07 2:04
gan_esh13-Mar-07 2:04 
AnswerRe: Images in ListControl Pin
Hamid_RT13-Mar-07 2:19
Hamid_RT13-Mar-07 2:19 
Questionwhich of the following to look at? Pin
ShaluMalu13-Mar-07 1:54
ShaluMalu13-Mar-07 1:54 
AnswerRe: which of the following to look at? Pin
James R. Twine13-Mar-07 2:00
James R. Twine13-Mar-07 2:00 
QuestionHow I can add elements in multiple columns in a OWNER Drawn List box? Pin
Sameer_Thakur13-Mar-07 1:49
Sameer_Thakur13-Mar-07 1:49 
QuestionRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Hamid_RT13-Mar-07 2:12
Hamid_RT13-Mar-07 2:12 
AnswerRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Sameer_Thakur13-Mar-07 3:23
Sameer_Thakur13-Mar-07 3:23 
GeneralRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Hamid_RT13-Mar-07 3:34
Hamid_RT13-Mar-07 3:34 
GeneralRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Sameer_Thakur13-Mar-07 3:51
Sameer_Thakur13-Mar-07 3:51 
GeneralRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Hamid_RT13-Mar-07 3:57
Hamid_RT13-Mar-07 3:57 
QuestionRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Hamid_RT13-Mar-07 18:22
Hamid_RT13-Mar-07 18:22 
GeneralRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Sameer_Thakur14-Mar-07 2:06
Sameer_Thakur14-Mar-07 2:06 
GeneralRe: How I can add elements in multiple columns in a OWNER Drawn List box? Pin
Hamid_RT14-Mar-07 3:18
Hamid_RT14-Mar-07 3:18 

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.