Archive

Archive for April, 2007

CTreeFileCtrl v1.46

April 22, 2007 Comments off

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

  • Fixed a bug in CTreeFileCtrl::OnItemExpanding when the control is created with the TVS_SINGLEEXPAND style. What was happening was that if for example you selected C:\program files using SetSelectedPath, then you selected "C:\" using the same function and then you selected "D:\", the control will end up showing no plus button on the C node. Thanks to John Emmas for reporting this quite difficult to find bug.
Categories: Web Site Updates

CFTPTransferDlg & CFTPTransferer v1.10

April 14, 2007 Comments off

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

Categories: Web Site Updates

Common problems compiling my code

April 14, 2007 Comments off

One of the common questions I get via email is why my code does not compile when they are using an old version of Visual C++ such as VC 6. For example here’s a recent email:

Dear PJ,
i am trying your SMTP class and it can not get it to compile. I get an error saying that the file <WinDNS.h> can not be opened….

The first thing you should do is check the line of code where this occurs. All you need to do is double click on the output window and it should take you to the offending line of code. Most of my code will anticipate errors such as this as we can see from this snippet of code from PJNSMTP.h:

#ifndef CPJNSMTP_NOMXLOOKUP
#ifndef _WINDNS_INCLUDED_
#pragma message("To avoid this message, please put WinDNS.h in your PCH (usually stdafx.h)")
#include <WinDNS.h> //If you get a compilation error on this line, then you need to download, install and configure the MS Platform SDK if you are compiling the code under Visual C++ 6
#endif
#endif

As you can see there is a comment saying that if you get this error that you need to download the Platform SDK from Microsoft.

Another thing you should do is check the usage section of the html file which comes with all of my source code. If we take a look at the PJNSMTP.htm file we see:

  • You will need to have downloaded, installed and configured the Platform SDK if you are compiling the code with Visual C++ v6.

Finally the question is how and where do I get the Platform SDK. The last version of the Platform SDK which was compatible with VC 6 was February 2003. The main link on the MSDN web site to download the SDK is http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en and from this there is another URL of http://www.qmedia.ca/launch/psdk.htm where you can download older versions of the SDK. On this page, there is a further link to https://www.qdirect.net/qmsfp/Product5.aspx?Item=1748 from where you can order the February 2003 Platform SDK.

Another question which crops us quite a lot also is failed to link to mfc42ud.lib or failed to link to mfc42u.lib. This occurs if you are using VC 6 and you are trying to compile either the Unicode Debug or Unicode build configuration of some of my code. In VC 6, the MFC unicode libraries were only installed if you did a custom install and most people may have simple omitted this. You have two choices, either:

  1. Update / Reinstall the missing components by rerunning the setup / install of VC 6, or
  2. Just compile the ASCII build configurations if you are not too worried about Unicode (which is another blog entry entirely). Normally these configurations will be called "Debug" and "Release" in most of my code downloads. To change the build configuration of a loaded workspace in VC 6, right mouse click on any toolbar, and ensure the item "Build" menu item is checked. Then in the build toolbar, select the second combo box and select either "Win32 Debug" or "Win32 Release" and do a rebuild all. The other two configurations of "Win32 Unicode Debug" and "Win32 Unicode Release" correspond to the Unicode build configurations as already discussed.

So in future before you email me with a comment of "some of your code fails to compile because …". Hopefully this will help out those newbie programmers with some of the common questions you have about my code.

Happy coding,

Categories: Programming

CTreeFileCtrl v1.45

April 13, 2007 Comments off

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

  • Updated IsDropSource method to now allow drag / drop of folders. Thanks to Kirk A. Baker for reporting this useful update.
  • The class now supports multiple filename masks. To support this new functionality, an updated / new set of functions have been provided, namely: AddMultipleFileNameMasks, SetFileNameMask, AddFileNameMask, RemoveFileNameMask, GetFileNameMask & GetFileNameMasks. Thanks to Fedor Gavrilov for this nice update.
Categories: Web Site Updates

DTime+ v3.09

April 13, 2007 Comments off

Just to let everyone know that v3.09 of DTime+ has been released. Updates for this version include:

  • Updated copyright details.
  • Updated sample apps to clean compile on VC 2005
  • Fixed a bug in CDate::Set(const CTime& ctime, …) and CLDate& CLDate::Set which incorrectly used GetGmtTm instead of GetLocalTm. Thanks to Martin Copland for reporting this bug.
Categories: Web Site Updates

XTaskDialog v1.06

April 5, 2007 Comments off

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

  • Fixed a bug where the code would not correctly set the initial selection state of the radio buttons in CXTaskDialog::OnInitDialog. Thanks to Demetrios A. Thomakos for reporting this bug.
Categories: Web Site Updates

ResSwitch & ResCopy v1.23

April 4, 2007 Comments off

Just to let everyone know that v1.23 of ResSwitch & ResCopy has been released. Updates for this version include:

  • Updated copyright details.
  • Updated the documentation to use the same style as the web site.
  • Optimized CVideoMode constructor code
  • Replaced call to _tprintf in GetCurrentVideoMode with a TRACE call.
  • Made the ResSwitch app unicode compliant.
  • Updated the code to clean compile on VC 2005
  • Now includes support for multiple monitors / display devices. This is achieved through the use of the newly provided CDisplayDevices class
  • GetAvailableVideoModes method now allows the device name to be specified for which display modes are to be obtained and the method has been renamed to just GetAvailable.
  • GetCurrentVideoMode has been renamed to the more appropriate name of GetCurrentForPrimaryDisplay
  • Removed RevertVideoModeToDefault, ChangeVideoModePermanently, ChangeVideoModeTemporarily, CanChangeVideoMode, ReportChangeVideoErrorValue and CreateCompatibleDEVMODE methods as they did not provide any useful encapsulation over calling the ChangeDisplaySettings SDK call directly. You can now think of the various classes in the Videomod module as a simple wrapper for enumerating the display devices and their associated display modes.
  • Added a m_dwDisplayFlags value to the CVideoMode class.
  • CAvailableVideoModes class is now called CAvailableDisplayModes.
  • CVideoMode class is now called CDisplayMode
  • CVideoModes class is now called CAvailableDisplayModes
  • Updated the documentation to use the same style as the web site.
  • Reworked ResCopy example to use a tree control to display all the details about all display devices, their attributes and available display modes
  • Addition of version infos to both exes included in the download.
  • Reworked ResSwitch application to provide a much more comprehensive set of command line parameters as well a general rework of its codebase.
Categories: Web Site Updates