Click here to Skip to main content
15,918,268 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Multiple Select in List Control Pin
Naveen22-Nov-09 17:12
Naveen22-Nov-09 17:12 
QuestionThe exact size of "string" problem [modified][Solved] Pin
tyftyftyf22-Nov-09 16:19
tyftyftyf22-Nov-09 16:19 
AnswerRe: The exact size of "string" problem [modified] Pin
«_Superman_»22-Nov-09 16:25
professional«_Superman_»22-Nov-09 16:25 
GeneralRe: The exact size of "string" problem Pin
tyftyftyf22-Nov-09 16:46
tyftyftyf22-Nov-09 16:46 
GeneralRe: The exact size of "string" problem Pin
«_Superman_»22-Nov-09 16:53
professional«_Superman_»22-Nov-09 16:53 
GeneralRe: The exact size of "string" problem Pin
tyftyftyf22-Nov-09 17:36
tyftyftyf22-Nov-09 17:36 
AnswerRe: The exact size of "string" problem [modified] Pin
JohnCz22-Nov-09 18:44
JohnCz22-Nov-09 18:44 
GeneralRe: The exact size of "string" problem Pin
tyftyftyf22-Nov-09 19:27
tyftyftyf22-Nov-09 19:27 
I see, I should copy a constructed null string first right? I used malloc because I was dealing with a multi-thread program, the thread which allocated and initialized the structure will die far before the structure is useless and should be deleted.So I'm consider using one thread allocate it, and another thread dispose it.

But C++ only allow "new" operator disposing a memory from a thread's local heap.So I used Windows API HeapAlloc and HeapFree, those two can allow two threads allocate and dispose memory from a same heap.

Then I encountered this initializing string problem.To make the code simpler, I wrote malloc instead of HeapAlloc, afterward I found out that these two are almost the same in single thread mode.

I guess I'm still just a beginner in C++.

ps: That program is a console, not MFC. I'd like to use BCB to design GUI. I'm still pretty confused about Windows Messages.

Thanks a lot.
GeneralRe: The exact size of "string" problem Pin
JohnCz23-Nov-09 6:10
JohnCz23-Nov-09 6:10 
GeneralRe: The exact size of "string" problem Pin
tyftyftyf23-Nov-09 16:55
tyftyftyf23-Nov-09 16:55 
GeneralRe: The exact size of "string" problem Pin
JohnCz23-Nov-09 17:36
JohnCz23-Nov-09 17:36 
Questionrunning time of java pograms Pin
cool_joy222-Nov-09 16:14
cool_joy222-Nov-09 16:14 
AnswerRe: running time of java pograms Pin
Richard MacCutchan22-Nov-09 21:36
mveRichard MacCutchan22-Nov-09 21:36 
GeneralRe: running time of java pograms Pin
cool_joy225-Nov-09 22:34
cool_joy225-Nov-09 22:34 
GeneralRe: running time of java pograms Pin
Richard MacCutchan25-Nov-09 23:49
mveRichard MacCutchan25-Nov-09 23:49 
GeneralRe: running time of java pograms Pin
cool_joy228-Nov-09 1:52
cool_joy228-Nov-09 1:52 
QuestionITextServices::Release() doesn't effect.That causes memory leaking. Pin
hawkgao012922-Nov-09 15:14
hawkgao012922-Nov-09 15:14 
QuestionError during compilation that I dont understand. [Solved] Pin
stianhh22-Nov-09 0:59
stianhh22-Nov-09 0:59 
AnswerRe: Error during compilation that I dont understand. Pin
Richard MacCutchan22-Nov-09 1:11
mveRichard MacCutchan22-Nov-09 1:11 
GeneralRe: Error during compilation that I dont understand. Pin
stianhh22-Nov-09 9:37
stianhh22-Nov-09 9:37 
GeneralRe: Error during compilation that I dont understand. Pin
Richard MacCutchan22-Nov-09 11:41
mveRichard MacCutchan22-Nov-09 11:41 
AnswerRe: Error during compilation that I dont understand. Pin
Cedric Moonen22-Nov-09 3:58
Cedric Moonen22-Nov-09 3:58 
QuestionCode snippet for searching a file in directory (directory can have subdirectories in it) Pin
V K 221-Nov-09 19:16
V K 221-Nov-09 19:16 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
22491721-Nov-09 19:47
22491721-Nov-09 19:47 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
breezes2008_22-Nov-09 0:35
breezes2008_22-Nov-09 0:35 

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.