Although your instincts may tell you otherwise, this is not how memory management[^] works. Your application has an internel working set[^] of memory. The operating system uses this extra memory to make your application faster since the memory is already allocated but simply marked as "stand-by". When you free your memory it does not mean your working set will decrease in size. The memory is simply marked as "not needed now, but maybe later" or "standby". I hope this makes sense.
It is possible to force all standby memory to be released by calling the SetProcessWorkingSetSize Function[^] with -1 for both arguments although its not recommended. It required the PROCESS_SET_QUOTA access right. You can severly harm application performance by abusing SetProcessWorkingSetSize. Note that this technique is not recommended for most applications.
I need help for coloring the CTabCtrl Window to white in MFC.
Actually I have a Tab control having Two tabs,I have not added Property pages, just put some controls like Edit box and Radio buttons on Tab control and on click of Each tab I am just hiding and showing some controls.
I want to make Tab control color white..
Please give me some sample code or some link for help..
It wouldn't work for any class, whether virtual or not.
There's not an implicit assignment operator for a type that takes a
base type as its right-hand operand. You must explicitly provide the
assignment operator or cast the left operand to a type that matches
an existing assignment operator overload.
Using a cast may hide the compiler error but if the operator overload that
the compiler chooses to call doesn't actually return a derived&, then you can't
rely on it being a derived object.
I'm trying to hook in a master "omg, we're going down, eject, eject, eject!" code chunk into my mfc dialog application. Basically, I do not want the user to see "chg.exe has done something bad and will need to terminate." What I want is to be able to capture as much forensic data to allow me to have a hope to diagnose what caused the crash.
So, in doing my research, I have seen two main approaches - override the run method of the CWinApp:
AfxMessageBox(_T("Exeption!!!")); // or trace or printf, does not matter.
I've also added the ProcessWndProcException handler at the app level as well.
What I have seen so far is that basically the code is ignored. If I hack up a little dialog app and divide by 0 or try to modify NULL, I see nothing at run time until I try to exit my app. What should one expect from these approaches?
Will program for food... Hurtling toward a government of the stupid, by the stupid, for the stupid we go. —Michelle Malkin