|
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- )
|
|
|
|
|
Give me some example (link would be nice) of these programs.
|
|
|
|
|
Hi Vaclav.
Well, you can download Motherboard Monitor http://www.softpedia.com/get/System/System-Info/Motherboard-Monitor.shtml[^]
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- )
|
|
|
|
|
Hello everyone,
I am learning how to use Excel to connect to other external data source (like database). What I want to do is to develop a plug-in for Excel and automatically access external data source, then display it in Excel tables.
Are there learning resource? I have tried to search in MSDN, but can not find any learning resources.
thanks in advance,
George
|
|
|
|
|
It sounds like you need to use the Workbook_Open event.
"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
|
|
|
|
|
Are there any comprehensive tutorials for beginners?
regards,
George
|
|
|
|
|
There are several names pointing to the same folder within Vista.
Example:
C:\Users
The folder is named "Benutzer" in Vista German Edition. So the Explorer shows "Benutzer", but my app shows "Users".
Can I retrieve the language-dependend name somewhere, and can I figure out if the folder uses is available through different names at all?
Same for the old "Documents and Settings" or the Programs-folder. Within explorer it's just a link that cannot be followed, but when you install old 32-bit programs under Vista, you can install them into the German or English name, but they will be only in one (the same) folder.
But in my app the links are just empty folders when I list the content.
So, are there classes comparable to FileInfoArray here at Codeguru that are up-to-date to be Vista-ready and backward compatible so it runs under XP without problems.
Thanks in advance, and sorry for my confusing style of explaining my problem.
Roland
|
|
|
|
|
Though I don't know what you are trying to achieve. In general, one should not mess with the "Documents And Settings" (Users in vista) folder directly.
You can query the user folder path (and other special folders) via the SHGetFolderPath function. CSIDL_PROFILE will find you the user's folder.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Thanks, but that was not my achievment. I realized that my question was asked in a quite confusing way.
To be more precise, I show a list of folders to the user, and through the usual directory listings you will not get the localized strings for some folders. In addition to the original name "Users" (which a common user would not even know since it's called "Benutzer" in german Vista) a lot of link-directories are shown. This is the "Dokumente und Einstellungen" and the "Documents and Settings" folder. So I have 2 empty folders - since they are not really there but shown through the old Win32 functions!
All I'd like to have would be a nice class or method to retrieve directory listings that already consider the localized names and offer information if such a folder is a real folder or one of those not-enterable.
Roland
|
|
|
|
|
I still don't really get it. Have you tried using SHGetFolderPath()?
Does it not get you what you are looking for?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Hello,
In my project, if i click a particular row in the list control, it will open a view. Like that if i click different row it will open different view. But when i try to open the view using click event, that was opened already, the focus is not set to the particular view. It is opening another window using "Openform". Is there any way to set the focus to already opened view.
Regards
Jagannathan
|
|
|
|