Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Urgent! Smart house with SMS project Pin
CPallini2-Jun-09 21:39
mveCPallini2-Jun-09 21:39 
QuestionMFC Process Pin
duongcntt4b2-Jun-09 15:39
duongcntt4b2-Jun-09 15:39 
QuestionRe: MFC Process Pin
David Crow2-Jun-09 16:52
David Crow2-Jun-09 16:52 
AnswerRe: MFC Process Pin
Stephen Hewitt2-Jun-09 20:34
Stephen Hewitt2-Jun-09 20:34 
AnswerRe: MFC Process Pin
duongcntt4b2-Jun-09 21:26
duongcntt4b2-Jun-09 21:26 
GeneralRe: MFC Process Pin
David Crow3-Jun-09 2:34
David Crow3-Jun-09 2:34 
QuestionC and C++ malloc and free Pin
jobin0070072-Jun-09 11:59
jobin0070072-Jun-09 11:59 
AnswerRe: C and C++ malloc and free Pin
John R. Shaw2-Jun-09 13:40
John R. Shaw2-Jun-09 13:40 
It sounds like you need to check who owns the memory you allocated. That is, if you allocate the memory and then attach it to an object of their library, it now belongs to that object; unless it is detached before that object is destroyed. There does not have to be a method named ‘Attach’ in order to pass ownership, it could be done via the constructor or some other method.

Of course the above could be wrong; it sounds like the pointer is no longer valid when you call ‘free’, because it has already been freed.

Calling ‘free’ is the only/correct way to free the memory allocated by ‘malloc’ or ‘calloc’.

Run some experiments and/or try locating the Microsoft article “Detecting and Isolating Memory Leaks Using Microsoft Visual C++” to get you started, or grab a trial version of one of the commercial memory tracker programs like Bounds Checker.

Good Luck!

INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

QuestionHelp compiling a library program in 'C' [modified] Pin
warpbro2-Jun-09 11:11
warpbro2-Jun-09 11:11 
QuestionRe: Help compiling a library program in 'C' Pin
David Crow2-Jun-09 16:54
David Crow2-Jun-09 16:54 
AnswerRe: Help compiling a library program in 'C' Pin
norish2-Jun-09 17:51
norish2-Jun-09 17:51 
GeneralRe: Help compiling a library program in 'C' [modified] Pin
warpbro3-Jun-09 4:13
warpbro3-Jun-09 4:13 
GeneralRe: Help compiling a library program in 'C' Pin
warpbro4-Jun-09 22:22
warpbro4-Jun-09 22:22 
QuestionHow to trace/log 3rd Party library API calls made by an application through WinDbg [modified] Pin
ComplexLifeForm2-Jun-09 8:51
ComplexLifeForm2-Jun-09 8:51 
Questioncalculte time between two dates !!! Pin
pillsforkills2-Jun-09 6:23
pillsforkills2-Jun-09 6:23 
QuestionRe: calculte time between two dates !!! Pin
CPallini2-Jun-09 6:36
mveCPallini2-Jun-09 6:36 
QuestionRe: calculte time between two dates !!! Pin
David Crow2-Jun-09 7:48
David Crow2-Jun-09 7:48 
Questionsha256 test vector Pin
Bill Salibrici2-Jun-09 5:52
Bill Salibrici2-Jun-09 5:52 
QuestionControl CStatic, Height of FONT Pin
durban22-Jun-09 4:28
durban22-Jun-09 4:28 
AnswerRe: Control CStatic, Height of FONT Pin
Hamid_RT2-Jun-09 5:17
Hamid_RT2-Jun-09 5:17 
AnswerRe: Control CStatic, Height of FONT Pin
nyeboy2-Jun-09 6:55
nyeboy2-Jun-09 6:55 
GeneralRe: Control CStatic, Height of FONT Pin
ForNow1-Jul-15 8:08
ForNow1-Jul-15 8:08 
Questionfunction Pin
durban22-Jun-09 4:07
durban22-Jun-09 4:07 
AnswerRe: function Pin
Chris Losinger2-Jun-09 4:10
professionalChris Losinger2-Jun-09 4:10 
NewsRe: function Pin
CPallini2-Jun-09 6:29
mveCPallini2-Jun-09 6:29 

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.