|
Hello,
I want to know when windows is not doing any work,
Please help me on this.
Thanks.
|
|
|
|
|
What windows?
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I think OnIdle Member Function will help u.
|
|
|
|
|
Windows is never idle, per se. It's always doing something, even in the OnIdle() handler. The default implementation updates menu items and toolbar buttons, and it performs internal data structure cleanup.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi,
I have a MFC application. when I compiled as 'Win32 Debug with MFC dll' it works fine, but when I compiled it as 'Win32 Release with MFC dll' I encountered an error:
the instruction at 0x77fc8f11 referenced memory at 0x9486f4f8. the memory could not be "written".
It occured every time I call a specific function from some dll that I load into the project, but not always in the same place (i.e. I might do some different actions in my application that will lead to this).
I stand a bit clueless here.
any help will be appriciated.
thanks,
Yaron.
|
|
|
|
|
|
Hi,
I have a general question on constructors in C++. If my constructor throws an exception is the object created? If so, is it a valid object? Can I invoke the methods of the class using that object?
How should you handle this scenario?
Thanks,
Mel
|
|
|
|
|
May be the answer can change depending on compiler, but as far as I know, the constructor is called after memory allocation has occurred and its first instructions (think as executed at the "open brace") are "call the bases constructors and call the members constructors".
At that point the object can be assumed as effectively constructed and formed.
The problem is another: if your object is used as a base of another object and your constructor throws an exception ... The "other" object is not properly constructed. But the memory is allocated.
But the other object constructor cannot handle the exception as well, since it didn’t reach any possible "try/catch" block. (It escaped from its open brace)
In fact your exception escapes the constructors leaving the instantiator (the piece of program that asked to create the outer object) with an allocated, but partially constructed object.
The fact that "delete" can be properly called by the calling program, mostly depend on what constructors and destructors do.
Moral: avoid to throw exceptions in constructors... a "two phase construction" (by calling a separate "init" function after the construction) can be safer and give a more predictable behaviour.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
No, the object is not created if the constructor throws an exception. See GotW #66[^] for a detailed discussion of the subject.
|
|
|
|
|
The C++ standard says that if a constructor throws an exception any memory allocated will be freed, but no destructor will be called. It is not a valid object and you cannot invoke members. If you try to do so the behaviour is undefined. In C++, undefined usually means it will crash.
I'm pretty sure that VC++ implements this behaviour correctly. In essence it wraps a new operation in a try /catch block and calls ::operator delete (or the class's operator delete , if it or a base class implements one), if C++ exception handling is enabled.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Dear Everybody,
I want to make my application can get a file name when i hook mouse at a known position.I have a idea that write a shell dll that capture file name when a mouse click event happened, then put file name to a shared memory with my application.Is is possible?If anyone show me other way to do, I would very appriciated.
Thank you in advanced.
|
|
|
|
|
In a dialog form there are three three edit boxes which and button.
The member variable of three edit boxes are of integer types.The three edit boxes represent the RGB color.Suppose if I click the button which on the form background color of the dialog form should according to the value entered the three edit boxes which are present on the dialog form.
The changing of the background color is given below
HBRUSH CBackColor1Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
if( pWnd == this)
{
pDC->SetTextColor(RGB(100, 255, 111));
pDC->SetBkColor(RGB(255, 255, 255));
hbr = (HBRUSH)(m_pBlackBkBrush->GetSafeHandle());
}
return hbr;
}
The code for the button control is given below
void CBackColor1Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
}
Can any one please tell how to integrate OnCtlColor member function with onButton1() member function .
Philip
|
|
|
|
|
if(pWnd->GetDlgCtrlID() == IDC_BUTTON1)
{
}
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
I guess you need to go through some of the basic Visual C stuff. For this, the best approach is to follow some basic level book. This will revise your concepts and make you a better programmer overall. Remember, Hit and Trail does not work always. You are trying to learn the Hard Way.
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
Hello ,
I am involved in automating keyboard keys in Client and to retrieve their states in Server .
I used keybd_event function to set the keys in client and
GetKeyState function to retrieve the state of the keys in the server.
Now when i run the client and server in the same machine , there is no problem .
But when i run the Server in different machine, the problem arises. Our tool is remote management tool where keyboard , video , mouse everything can be redirected. So when the user press the key in the client machine ,in the server also tat key will be pressed. But when i try to get the key state in the server , it tells that the key is not pressed.
Plz help me what other functions can be used other than keybd_event and GetKeyState can be used to set and retrieve the keys...in keyboard
|
|
|
|
|
are there some c++ functions used for checking serial numer of a CD?
thx
includeh10
|
|
|
|
|
|
can any tell me how change the background color of a button ?
Can anyone help me in this matter.
Philip
|
|
|
|
|
|
You beat me By 1 Sec , MY Typing and Net Connection are getting Slower day by Day
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Modify the Style of Button to Owner Draw and in OnCtlColor , as i told last day
look for ID of CTLCOLOR_BTN in UINT nCtlColor
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Selvam
|
|
|
|
|
Can any one tell me the use of "this pointer" in vc++?
//
if(pWnd == this)
//
In the above code, what is the signifance of the above code ?
Philip
|
|
|
|
|
Hi,
"this pointer" use to point the current object.
if(pWnd == this)<br />
In above code check the current object is pWnd(Window) object.
Regards,
Selvam
|
|
|
|
|
phijophlip wrote:
Can any one tell me the use of "this pointer" in vc++?
See here.
phijophlip wrote:
if(pWnd == this)
//
In the above code, what is the signifance of the above code ?
It is comparing two objects to see if they are equal.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|