|
Thanks, David --- you da man!
John P.
|
|
|
|
|
Since you're usimg MFC, just associate a double variable instead of a string with the windows. DDX will handle the conversions for you.
Judy
|
|
|
|
|
Thanks, Judy. I was not aware of that. That is very useful to know. I appreciate your response.
John P.
|
|
|
|
|
how to display messagebox when click system menu(X) on dialogbox.
Thank to all
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Derive your own class from CDialog and override the OnClose() function which is called by the system when the [X] button is pressed.
|
|
|
|
|
Just handle the cancel button click event.
void CYourDlg::OnBnClickedCancel()
{
AfxMessageBox("Don't close!");
}
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
He wants to catch the [X] in the system-menu, not the Cancel button ...
Here's the code:
void CYourDlg::OnClose()
{
AfxMessageBox("Don't close!");
}
... and don't forget to add the ON_WM_CLOSE() macro in the dialog's message-map.
|
|
|
|
|
Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required!
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Hey, I just checked it, and you know what ? You're absolutely right !!!
Sorry, my bad You rule !!
Guy.
|
|
|
|
|
VuNic wrote: Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required!
What do you mean by "mentioning WM_CLOSE is required"?
|
|
|
|
|
Assuming he's operating on a default dialog with OnCancel implemented, he can simply override it and handle it by the way he wanted. It works without him needing to make any extra effor. But ofcourse handling WM_CLOSE is the proper way. That apparently relates to [X] close!.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Actually I was searching for OnCancel but it's not there with 7.1 compiler. VS6.0 displays the cancel event handler as "::OnCancel". but in 7.1 it's generating OnBnClickedCancel.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Why would you suggest that? If you write your code in OnCancel() , then it would be obviously executed when the Esc key is pressed and also when the cancel button is pressed. Handling WM_CLOSE is the right way.
|
|
|
|
|
Yeah, nobody would want their application to get closed with an Esc. I really wonder why MFC has it that way :unsure:. So handling WM_CLOSE is the best way. Thanks for stressing that one out.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
VuNic wrote: Yeah, nobody would want their application to get closed with an Esc.
You assume things.
VuNic wrote: I really wonder why MFC has it that way :unsure:. So handling WM_CLOSE is the best way.
That is by design. Pressing the Esc key in a dialog based app will execute some extremely old windows code. As a developer, you are not supposed to develop complex applications which is dialog based. As a user, he would always expect a dialog to get dismissed when the Esc key is pressed. For instance, if you right click on the desktop and choose properties, you will expect the properties window to get dismissed on pressing Esc. I am working on my first article, and I have elaborated on this dialog box closing glitch issue more clearly.
|
|
|
|
|
brahmma wrote: and I have elaborated on this dialog box closing glitch issue more clearly.
Wow.. waiting for it . Bram, do you work with MDI-DOC/View thing?
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
I stopped working with MFC quite a long time ago. Currently I am working on Windows Mobile and embedded C (Dynamic C). I have worked with MDI applications too, but for some reason I love dialog based applications and hooking and spying out stuff from within a DLL.
|
|
|
|
|
Yeah me too, in general I hate UIs to a good extent.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
|
deeps_cute wrote: how to display messagebox when click system menu(X) on dialogbox.
handle oncancel function
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi.
First, I don't know if this is the right forum to post this question, if not, sorry and someone move this post to the right forum.
In the Web we can find some programs that telling you the microprocessor temperature, the fact is I don't trust in those programs, you know, spyware, risks performing low level routines, etc.
So I want to write my own program to "read" the micro temperature, the question is, where should I start?. I have good skills in MFC and also I know assembly, but I can't figure where should I start?.
My micro is a Peuntium 4, I think every micro is different so I'm looking for technical docs about my micro and motherboad, but all the documentation I found nothing says about routines to perform.
Any comment will be appreciated.
Thank you and regards.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
If your motherboard has a temperature sensor, use the Win32_TemperatureProbe WMI class.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ok David, I'm going to try this, I need to read something before because is the first time I see WMI . Every day there is something new to learn
Thank you very much for your time.
Best Regards.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Yes David answers to you see Win32_TemperatureProbe[^] it has example(I wanted to answer you but I dont know I had a problem)
|
|
|
|
|
Hi WhiteSky.
Reading the link you've posted....
Best regards.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|