Archive

Archive for January, 2008

CExceptionLogger v1.10

January 24, 2008 1 comment

Just to let everyone know that v1.10 of CExceptionlogger has been released. Updates for this version include:

  • Updated to support creating minidumps
  • The location for the logging file and the minidump file is now your temp directory. This means that files will be correctly created even with least-privileged user accounts, and it also prevents the files from taking up hard drive space after they are no longer needed.
  • The name for the logging file is "YYMMDDHHMMSSmmm_name of exe.exception".
  • The name for the minidump file is "YYMMDDHHMMSSmmm_name of exe.dmp".
  • Support for EXCEPTION_LOGGER_ONE_EXCEPTION_PER_FILE has been dropped as now the filenames include timestamps to make them unique.
  • Updated sample app to clean compile on VC 2005 + VC 2008.
  • Updated copyright details.
  • Updated sample app to remove VC 6 style appwizard comments
  • Updated sample app to use C++ style casts instead of C style casts
  • Because the logging and minidump files now are hard coded to include timestamps, the SetXCPTHLRFileName function has been replaced with SetXCPTHLRDirectory. By default this is set to your temp directory. A corollary SetXCPTHLRDirectory function is now also available.
  • Updated usage instructions in the documentation.
  • Binaries included in download are now build with VC 2005 SP1
Advertisements
Categories: Web Site Updates

ShelExec v1.17

January 12, 2008 1 comment

Just to let everyone know that v1.17 of ShelExec has been released. Updates for this version include:

  • Updated copyright details.
  • Removed VC 6 style classwizard comments.
  • Code now uses the FORMAT_MESSAGE_IGNORE_INSERTS flag when calling FormatMessage. For more information please see Raymond Chen’s blog at http://blogs.msdn.com/oldnewthing/archive/2007/11/28/6564257.aspx. Thanks to Alexey Kuznetsov for reporting this issue.
  • App now supports environment variable substitution in the Dir and DocumentFile parameters.
  • App now no longer passes GetDesktopWindow() for the parent window in the call to ShellExecuteEx.
  • App now no longer bothers reporting any errors back since the ShellExecuteEx call is doing this for us anyway because we are not passing the SEE_MASK_FLAG_NO_UI flag.
  • The app now no longer creates the hidden window if the call to ShellExecuteEx was unsuccessful.
Categories: Web Site Updates

CPDH v1.11

January 12, 2008 Comments off

Just to let everyone know that v1.11 of CPDH has been released. Updates for this version include:

  • Updated copyright details.
  • Updated the code and sample app to clean compile on VC 2008
  • CPdhException::GetErrorMessage now only calls the FormatMessage function once. The second call is not required following a review of the FormatMessage documentation.
  • CPdhException::GetErrorMessage now uses the correct return value from FormatMessage.
Categories: Web Site Updates

MfcCDDB v1.30

January 12, 2008 Comments off

Just to let everyone know that v1.30 of MfcCDDB has been released. Updates for this version include:

  • Updated copyright details.
  • Updated sample app code to remove VC 6 style classwizard comments
  • Updated the sample app to clean compile on VC 2008
  • CCDDBException::GetErrorMessage now uses the FORMAT_MESSAGE_IGNORE_INSERTS flag. For more information please see Raymond Chen’s blog at http://blogs.msdn.com/oldnewthing/archive/2007/11/28/6564257.aspx. Thanks to Alexey Kuznetsov for reporting this issue.
  • CCDDBException::GetErrorMessage now uses Checked::tcsncpy_s if compiled using VC 2005 or later.
Categories: Web Site Updates

CNTService v1.75

January 12, 2008 Comments off

Just to let everyone know that v1.75 of CNTService has been released. Updates for this version include:

  • Updated copyright details.
  • Provided a link to my blog in the html documentation with details on compiling with VC 6.
  • CNTService::Win32ErrorToString method has been reworked to now uses the FORMAT_MESSAGE_IGNORE_INSERTS flag. For more information please see Raymond Chen’s blog at http://blogs.msdn.com/oldnewthing/archive/2007/11/28/6564257.aspx. Thanks to Alexey Kuznetsov for reporting this issue.
  • Updated the sample app to clean compile on VC 2008.
  • SecureEmptyString method is now defined as "FORCEINLINE".
Categories: Web Site Updates

MFC Feature Pack for Visual C++ 2008

January 12, 2008 2 comments

I’ve just downloaded and installed the beta of the MFC and TR1 enhancements for Visual C++ 2008 and started to play around with the new functionality. You can download the beta from http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en and the documentation which at the moment are stand alone chm files from http://www.microsoft.com/downloads/details.aspx?FamilyId=0D805D4E-2DC2-47C7-8818-A9F59DE4CD9B&displaylang=en. I was aware that this was going to be made available in January but actually found out about the release from the Visual C++ Team Blog at http://blogs.msdn.com/vcblog/. I’ve just ran through creating a new MFC application using the updated AppWizard and it allows you to play around with all the new UI enhancements. The size of the x86 MFC file has grown from 1130 KB (v9.0.21022.8 which was VC 9 RTM) to 3666 KB (v9.0.21204.0 which is the current beta of the Feature Pack). That’s a nearly 3 fold increase in the main ASCII MFC DLL and dramatically represents the major reinvestment which Microsoft has put back into MFC. Installing the beta puts the files in the usual WinSxS directory underneath your Windows directory. Similar to VC 2005 SP1 a policy redirect is setup to cause applications to load the new MFC DLL rather than the RTM version. The feature pack also comes with TR1 enchantments but that’s not an area I am too much interested in at the moment. Here’s some breakdown of some of the new features I’ve discovered during my play around with the beta:

  • The install for the Feature pack comes in at a 303 MB download. It takes about 30 minutes or so to install and appears as a patch / update for VC 2008 called KB 945273
  • Most of the new MFC classes appear as new classes with the naming convention CMFC… which are derived from their existing MFC counterpart classes. For example the new CMFCToolTipCtrl is derived from the existing CToolTipCtrl class. Other examples of new classes which use this style include CWinAppEx, CMFCToolBar, CFrameWndEx, CMFCStatusBar etc etc. This approach means that you can add the new features to your existing applications using a staged approach.
  • The new MFC functionality is not new code developed in house by MS but has been licensed from the Russian software development company BCGSoft. I’ve no problem with this as the code quality looks very good and MS already has a history of using external code before in VC e.g. the Standard library and the new TR1 functionality from Dinkumware.
  • You will need to redistribute updated VC runtime components with your application instead of the VC 2008 RTM components.
  • Most of the new MFC classes have a one to one mapping to a new MFC header / source code module in the "ATLMFC" directory in VC. I’ve counted roughly 180 or so new source code modules in the ALTMFC\src\mfc directory most using the "afx*" naming convention. In the "ATLMFC\include" directory, there appears to be about the same amount of new header modules.
  • A complete Theming framework to support a Office XP, 2003 and 2007, Windows 2000, XP, and Visual Studio 2005 look and feel is provided. These features can even be toggled at runtime. All of this functionality is based on the new CMFCVisualManager* classes.
  • The Office 2007 Ribbon control is also faithfully emulated and available. This is provided via the new CMFCRibbon* classes.
  • MDI Tabbing. Instead of using the old style MDI interface, you can use tabs for multiple documents. The style of tabs can be customized similar to the theming support. You can also implement split tabs just like in VC 2005/2008. You can also use this MDI Tabbing to provide a UI similar to the Worksheet tabs used in Microsoft Excel.
  • Extensive runtime customization is provided. For example you can drag and drop commands onto any location on the menu bar or the toolbar. Keyboard accelerators and the styles of menus and toolbars can also be changed. Menus can also be configured to only show recently used commands first with older commands exposed when you hit an expand button.
  • A docking panels infrastructure is now available similar to those available in Visual Studio 2005 and later. Features such as Auto Hide, Floating, Tabbing, and Hiding are all faithfully implemented. 
  • You can create a "Caption Bar" similar to the control which Internet Explorer pops up when it tells you that it has blocked a popup window from appearing (CMFCCaptionBar).
  • As with most of the new MFC classes which are window controls, all the hard work is done by the new classes themselves rather than being simple wrappers over standard Windows common controls. This has the advantage that you will get most of the next functionality on down-level operating systems such as Windows 2000. An example would be using the new CMFCLinkCtrl class instead of the CLinkCtrl class which is only available if you are running on XP and have compiled your app to use Common Control v6. BTW, quite a few of the new MFC classes will obsolete my own open source MFC classes. For example, the new MFCLinkCtrl class will obsolete my CHLinkCtrl class! 
  • Quite a few CButton classes on CodeProject will become obsolete with the new CMFCButton class. It includes support for quite a few nice features such as aligning button text, combining text and images, custom cursors, tool tips and split menus.
  • A selection of color picker classes including CMFCColorButton, CMFCColorDialog, CMFCColorMenuButton and CMFCColorPickerCtrl are now available. A really great example of using them is provided in the updated classic MFC sample "DrawClient" where the color of specific parts of the object being drawn are changed dynamically as you hover over various parts of the new Ribbon UI. This allows you to explore functional parts of an application without actually performing that operation and then "undoing" that operation.
  • Toast style windows can be created using the new CMFCDesktopAlertWnd & CMFCDesktopAlertDialog classes. Similar to the rest of the framework, you can change the style of the window to look like MSN Messenger or Office 2007 amongst others, change the animation type, icon, animation speed and transparency. These classes will obsolete my CToasterWnd class!
  • Advanced tooltip features such as icons, labels, gradient fills, bold text and balloon style are available via the CMFCToolTipCtrl, CMFCToolTipInfo & CMFCToolTipManager classes.
  • Both the left hand side (Tree View) and right hand side (List View) of Windows Explorer are implemented as the new CMFCShellTreeCtrl and CMFCShellListCtrl classes. A new sample called "Explorer" shows how these classes can be used to implement an app similar to the real Windows Explorer application. The new CMFCShellTreeCtrl class will partially obsolete my CTreeFileCtrl class!
  • My CChooseDirDlg class has now been obsoleted by CShellManager::BrowseForFolder!
  • An Outlook Bar control is available via the new CMFCOutlookBar* classes. You can also use these classes in conjunction with new Property Sheet classes to create a compound control which looks kinda similar to the Options window in Skype.
  • A Properties List control is available via the new CMFCPropertyGrid* classes. These will partially obsolete my CListOptionsCtrl class!
  • Task Panes similar to those which Windows Explorer can show for selected folders can be created via the new CMFCTasksPane* classes.
  • Persistence of the UI state is saved across application invocations and the underlying framework used to support this is provided by the new CSettingsStore class.
  • A handy new CFontComboBox class has been provided.
  • A new CVSListBox class provides a editable list control which allows you to create, modify, delete or rearrange a list of items.
  • A very nice Masked Edit control is now available via the CMFCMaskedEdit class. A new sample called "NewControls" provides examples of how this enhances the entry of a phone number, a numeric value, a custom serial code etc.
  • A new CEditBrowseCtrl class provides a mechanism to easily select a file or folder or custom value within a standard edit control. This will obsolete my DDXFile and DDXFolder classes!
  • A new CMFCImageEditorDialog class provides a simple dialog box that allows editing of a bitmap something similar to the bitmap editor in Visual Studio or the Microsoft Paint application.
  • The lowly status bar has been given some new features including support for images, animations, double click support and progress bars via the new CMFCStatusBar class.

These areas are just some of the features which caught my eye and with 190 or so new MFC modules to peruse I’m sure there are some real gems which I have missed. All of this new functionality is really welcome to MFC and really reinvigorates the MFC development scene. I can’t wait to see the final release of the Feature Pack hopefully in March or April of this year.

Categories: Programming