Click here to Skip to main content
15,906,628 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PDF Viewer Pin
Joel Lucsy11-Feb-04 2:57
Joel Lucsy11-Feb-04 2:57 
GeneralHelp with memory leak warning message Pin
J.B.11-Feb-04 2:15
J.B.11-Feb-04 2:15 
GeneralRe: Help with memory leak warning message Pin
Antti Keskinen11-Feb-04 2:31
Antti Keskinen11-Feb-04 2:31 
GeneralRe: Help with memory leak warning message Pin
J.B.11-Feb-04 5:21
J.B.11-Feb-04 5:21 
GeneralRe: Help with memory leak warning message Pin
Antti Keskinen11-Feb-04 6:34
Antti Keskinen11-Feb-04 6:34 
GeneralRe: Help with memory leak warning message (solved) Pin
J.B.11-Feb-04 17:11
J.B.11-Feb-04 17:11 
GeneralRe: Help with memory leak warning message (solved) Pin
Antti Keskinen11-Feb-04 18:41
Antti Keskinen11-Feb-04 18:41 
GeneralRe: Help with memory leak warning message (solved) Pin
J.B.12-Feb-04 6:04
J.B.12-Feb-04 6:04 
Antti Keskinen wrote:
So, call the manual destruction method of the class in the OnOk handler. I think this should remove at least one or two of the memory leaks.

Antti, I further experimented by declaring m_statusbar as a class member and explicitly destroy it upon my overriden OnCancel() call (where all my exit routines go through). Unforunately, to my surprise it did not seem to make any difference. The three memory leaks would still exist, while making m_statusbar as a global variable completely dismisses the memory leaks (at least no longer in the debug window anyway). Can this be explained?

Antti Keskinen wrote:
Accessing a class directly from across the thread is dangerous, because the memory areas might become corrupted. Instead, add handlers for different messages in your status bar class, and register a set of new Windows messages for your convinience.

Yes, SendMessage() is what I've learnt to use later and I found is quite efficient and reliable. However, I am just wondering for those object pointers I previously created for directly class access and have worked successfully within multiple threads, can I be safe to leave them as they are, without having to worry about memory corrupton? Or the corruption is still possible as more objects are being made later.

Thank you again, Antti
Johnny
GeneralRe: Help with memory leak warning message Pin
Peter Weyzen11-Feb-04 7:42
Peter Weyzen11-Feb-04 7:42 
GeneralRe: Help with memory leak warning message Pin
Graham Bradshaw11-Feb-04 3:49
Graham Bradshaw11-Feb-04 3:49 
GeneralReading the USB port Pin
Demian Panello11-Feb-04 2:01
Demian Panello11-Feb-04 2:01 
GeneralRe: Reading the USB port Pin
Antti Keskinen11-Feb-04 2:35
Antti Keskinen11-Feb-04 2:35 
GeneralRe: Reading the USB port Pin
Demian Panello11-Feb-04 4:54
Demian Panello11-Feb-04 4:54 
Generaledk.h Pin
barzw11-Feb-04 1:08
barzw11-Feb-04 1:08 
GeneralRe: edk.h Pin
Michael P Butler11-Feb-04 1:18
Michael P Butler11-Feb-04 1:18 
Generalmachine code Pin
Anonymous11-Feb-04 0:53
Anonymous11-Feb-04 0:53 
GeneralRe: machine code Pin
Prakash Nadar11-Feb-04 1:04
Prakash Nadar11-Feb-04 1:04 
GeneralRe: machine code Pin
Anonymous11-Feb-04 1:13
Anonymous11-Feb-04 1:13 
GeneralRe: machine code Pin
jmkhael11-Feb-04 1:30
jmkhael11-Feb-04 1:30 
GeneralRe: machine code Pin
Anonymous11-Feb-04 1:37
Anonymous11-Feb-04 1:37 
GeneralRe: machine code Pin
jhwurmbach11-Feb-04 2:47
jhwurmbach11-Feb-04 2:47 
GeneralRe: machine code Pin
Antti Keskinen11-Feb-04 3:04
Antti Keskinen11-Feb-04 3:04 
GeneralRe: machine code Pin
Prakash Nadar11-Feb-04 1:35
Prakash Nadar11-Feb-04 1:35 
GeneralRe: machine code Pin
Alexander M.,11-Feb-04 5:10
Alexander M.,11-Feb-04 5:10 
GeneralRe: machine code Pin
jmkhael11-Feb-04 6:38
jmkhael11-Feb-04 6:38 

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.