|
You may also use inflate with negative values.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Juat assign a new value to the right member:
rect.right = rect.left + the_new_width;
|
|
|
|
|
Hi all,
I have made a Dialog box in vc2008 and have made several control on it....
at end i want to release memory occupied by all the controls...
How can i do this??
Thanks in advance
|
|
|
|
|
|
How did you make them?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
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.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi all,
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..
Thanks in advance
|
|
|
|
|
|
Hi,
I wonder why a derived class can not use its base class's virtual operator = function. For example, code like this can not pass compilation:
#include <iostream>
using namespace std;
class base
{
public:
virtual base & operator = (const base &other) {}
};
class derived : public base
{
};
int main()
{
derived d;
base b;
d = b; //compiler says no operator = found
return 0;
}
thanks,
Bob
|
|
|
|
|
Just a Casting Problem
Try Again As Follows:
(base)d = b;
Regards,
Bram van Kampen
|
|
|
|
|
yes, typecast works. But what I mean is why derived can not directly use "=" if it inherits it from base?
thanks,
Bob
|
|
|
|
|
The assignment operator used is chosen based on the
type of the variable being assigned to. To use the base
assignment operator without a cast would require an overload
that returns a derived.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is it in the specification of C++? If not, what I can see is the derived class inherits all of the information of the function in the bass class, including the return value.
thanks,
Bob
|
|
|
|
|
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.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Also..
It is stated here[^] that assignment operators are not inherited.
Take a close look at this[^] example as well.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you so much. Now I am clear.
Bob
|
|
|
|
|
AFAIK, In C++, operator = is not inherited.
|
|
|
|
|
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:
<br />
<br />
int CMyApp::Run() <br />
{<br />
BOOL bRun;<br />
BOOL bExit=FALSE;<br />
<br />
while(!bExit)<br />
{<br />
try<br />
{<br />
bRun= CWinApp::Run();<br />
bExit=TRUE;<br />
}<br />
catch (...)<br />
{<br />
AfxMessageBox(_T("Exeption!!!"));
}<br />
}<br />
return bRun;<br />
}<br />
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?
Charlie Gilley
Will program for food...
<italic>Hurtling toward a government of the stupid, by the stupid, for the stupid we go. —Michelle Malkin
|
|
|
|
|
|
I'll take a look this evening.... thanks
Charlie Gilley
Will program for food...
<italic>Hurtling toward a government of the stupid, by the stupid, for the stupid we go. —Michelle Malkin
|
|
|
|
|
|
Hi,
Is there a way to catch Exceptions in my SDI MFC application in a very low level?
What I mean: I work with an SQL database and it may be that I have an error in the SQL syntax etc. In this case a specific exceptions is thrown.
I do not want to catch it somewhere in my code for View/Document but rather somewhere in the application object and then just display an error message and terminating my application the right way (including calling of all destructors).
When I do not catch them, I get a "Runtime error" in the debug version. I would like to have this similar behaviour.
Regards,
Niki
|
|
|
|
|
You can add a global exception handler using the SetUnhandledExceptionFilter Function[^] and catch all SQL related errors and return EXCEPTION_EXECUTE_HANDLER for all other exceptions or maybe handle them as well.
Best Wishes,
-David Delaune
|
|
|
|
|
|
i can easily send mails with ASP VB etc..
but i could not send mail with "CDO.Message" in C++
i have tried lots of sample code around the web
but none of them worked well,
i am always getting lots of compiler error
please , could you show me a working sample that uses "CDO.Message"
Here is a sample[^] from MSDN
envirounment Visual Studio .NET 2003
note :
i do not want to use a pre-written SMTP class (FireWall problems etc..)
thanks.
|
|
|
|