New VC++ 7.0 tidbits
-
Part 1. Static Casting and MFC Message Maps: Beginning with Visual C++.NET, MFC provides stricter type checking for return and parameter types of message handler functions. This new behavior notifies the developer of potential problems by flagging potentially unsafe message handlers with an error message. MFC now uses static casts for ON_MESSAGE, ON_REGISTERED_MESSAGE, ON_THREAD_MESSAGE, and ON_REGISTERED_THREAD_MESSAGE. For example, in the past a developer could use a member function that returned void instead of LRESULT for ON_MESSAGE or ON_REGISTERED_MESSAGE and compile without any errors. With Visual C++ 7.0, the potential miscast is caught and flagged as an error. The developer can quickly fix the potential problem by replacing the return type (with LRESULT) and recompiling. New functions to allow dates beyond the year 2038:
-
Part 1. Static Casting and MFC Message Maps: Beginning with Visual C++.NET, MFC provides stricter type checking for return and parameter types of message handler functions. This new behavior notifies the developer of potential problems by flagging potentially unsafe message handlers with an error message. MFC now uses static casts for ON_MESSAGE, ON_REGISTERED_MESSAGE, ON_THREAD_MESSAGE, and ON_REGISTERED_THREAD_MESSAGE. For example, in the past a developer could use a member function that returned void instead of LRESULT for ON_MESSAGE or ON_REGISTERED_MESSAGE and compile without any errors. With Visual C++ 7.0, the potential miscast is caught and flagged as an error. The developer can quickly fix the potential problem by replacing the return type (with LRESULT) and recompiling. New functions to allow dates beyond the year 2038:
Part II DHTML editing component: CHtmlEditCtrl, CHtmlEditView, CHtmlEditDoc DHTML dialog boxes: CDHtmlDialog, CMultiPageDHtmlDialog ISAPI support for parsing argument lists: CHttpArg, CHttpArgList Support for windowless controls: COleControlSite, COleControlContainer, and COccManager Enhanced support for using HTML Help in an MFC application: Displaying the Help Viewer. Windows 2000 print property sheet: CPrintDialogEx. DAO support: The Visual C++ MFC AppWizard and MFC DLL AppWizard no longer support DAO database projects. You can still add DAO-derived classes using the Add Class wizard. Microsoft recommends using OLE DB or ODBC for new native C++ projects. You should only use DAO in maintaining existing applications.
-
Part II DHTML editing component: CHtmlEditCtrl, CHtmlEditView, CHtmlEditDoc DHTML dialog boxes: CDHtmlDialog, CMultiPageDHtmlDialog ISAPI support for parsing argument lists: CHttpArg, CHttpArgList Support for windowless controls: COleControlSite, COleControlContainer, and COccManager Enhanced support for using HTML Help in an MFC application: Displaying the Help Viewer. Windows 2000 print property sheet: CPrintDialogEx. DAO support: The Visual C++ MFC AppWizard and MFC DLL AppWizard no longer support DAO database projects. You can still add DAO-derived classes using the Add Class wizard. Microsoft recommends using OLE DB or ODBC for new native C++ projects. You should only use DAO in maintaining existing applications.
-
Ah! nice to hear all these improvements. I was bored with that non-stop .Net/C# bombardment. Can someone please write an article on the new additions / changes to MFC7.0. TIA.
-
Part 1. Static Casting and MFC Message Maps: Beginning with Visual C++.NET, MFC provides stricter type checking for return and parameter types of message handler functions. This new behavior notifies the developer of potential problems by flagging potentially unsafe message handlers with an error message. MFC now uses static casts for ON_MESSAGE, ON_REGISTERED_MESSAGE, ON_THREAD_MESSAGE, and ON_REGISTERED_THREAD_MESSAGE. For example, in the past a developer could use a member function that returned void instead of LRESULT for ON_MESSAGE or ON_REGISTERED_MESSAGE and compile without any errors. With Visual C++ 7.0, the potential miscast is caught and flagged as an error. The developer can quickly fix the potential problem by replacing the return type (with LRESULT) and recompiling. New functions to allow dates beyond the year 2038:
The "Subject" of this post says it all. I once spent a full half a day tracking down a crash due to an incorrect signature in an ON_NOTIFY_EX() handler - while sitting on a boat in Plymouth Sound (supposedly) conducting a sea trial of our company's subsea navigation software (let's see now, 5 engineers idle for 4 hours at about £50/hour...I could do with some of that ). Hopefully the guys at Redmond will realise they need to do the other message handler macros as well. :( Strangely enough, Paul DiLascia suggested exactly this in his "C++ Q & A" article in the :cool: July 1999 edition of MSJ. Methinks someone at Redmond liked that article... Andy Metcalfe - Sonardyne International Ltd
(andy.metcalfe@lineone.net)
http://www.resorg.co.uk"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
-
Part 1. Static Casting and MFC Message Maps: Beginning with Visual C++.NET, MFC provides stricter type checking for return and parameter types of message handler functions. This new behavior notifies the developer of potential problems by flagging potentially unsafe message handlers with an error message. MFC now uses static casts for ON_MESSAGE, ON_REGISTERED_MESSAGE, ON_THREAD_MESSAGE, and ON_REGISTERED_THREAD_MESSAGE. For example, in the past a developer could use a member function that returned void instead of LRESULT for ON_MESSAGE or ON_REGISTERED_MESSAGE and compile without any errors. With Visual C++ 7.0, the potential miscast is caught and flagged as an error. The developer can quickly fix the potential problem by replacing the return type (with LRESULT) and recompiling. New functions to allow dates beyond the year 2038:
-
Have we clearance to publish "What new in Visual C++ 7.0"? I don't wont to post anything, if I'm going to break any license agreenents.
You should be able to publish articles on VC++ 7.0 improvements, I think Richard Grimes already has done so. If you have some plans to do so, send me some private email and I'll just double check for you...but I'm 90% sure its not a problem. Walter Sullivan Lead Program Manager, ATL/MFC walters@microsoft.com