Archive
CTreeFileCtrl v1.46
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.
CFTPTransferDlg & CFTPTransferer v1.10
Just to let everyone know that v1.10 of CFTPTransferDlg & CFTPTransferer has been released. Updates for this version include:
- Updated copyright details.
- Following feedback from Philippe MARINUTTI, it looks like you just cannot do FTP resumes using Wininet. For more information on the issues involved, please see http://groups.google.com/group/microsoft.public.inetsdk.programming.wininet/browse_thread/thread/b43094df4de38a35/376b4c14acdb9be6?lnk=st&q=FtpCommand+REST&rnum=9&hl=en#376b4c14acdb9be6, http://groups.google.com/group/microsoft.public.inetsdk.programming.wininet/browse_thread/thread/229a31ebda334098/4facc1ebcc9a7c2e?lnk=st&q=FtpCommand+REST&rnum=6&hl=en#4facc1ebcc9a7c2e, http://groups.google.com/group/microsoft.public.inetsdk.programming.wininet/browse_thread/thread/5f1a1d5c92e6548d/1dfcc8fb46c6c721?lnk=st&q=FtpCommand+REST&rnum=10&hl=en#1dfcc8fb46c6c721 & http://groups.google.com/group/microsoft.public.inetsdk.programming.wininet/browse_thread/thread/31a840505f3b45bc/8c1732d682ba4f7b?lnk=st&q=FtpCommand+REST&rnum=1&hl=en#8c1732d682ba4f7b. As such I have removed support for resumes (CFTPTransferer::m_dwStartPos) from the code. If you would like to support FTP resumes, then you will need to look to commercial alternatives such as SmartFTP (http://www.smartftp.com/ftplib/), Xceed FTP Library (http://xceed.com/FTP_ActiveX_Intro.html), or FTP Client Engine for C/C++ (http://www.marshallsoft.com/fce4c.htm).
Common problems compiling my code
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:
- Update / Reinstall the missing components by rerunning the setup / install of VC 6, or
- 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,
CTreeFileCtrl v1.45
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.
DTime+ v3.09
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.
XTaskDialog v1.06
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.
ResSwitch & ResCopy v1.23
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.
Ask PJ
Just to let everyone know that I have set up an "Ask PJ" page on my web site. From this you can directly email me with your difficult Windows programming questions and I will try my best to respond to your question
CToasterWnd v1.10
Just to let everyone know that v1.10 of CToasterWnd has been released. Updates for this version include:
- Fixed a bug in the LoadHTML and LoadUrl methods where they were incorrectly using the main window handle of the toaster window instead of the window handle of the HTMLayout child control. Thanks to Itamar Syn-Hershko for reporting this bug.
MVP Award
It may be April Fools day today, but I got an email from Microsoft today, to confirm that I have just been made an MVP (Microsoft Valuable Professional). I was nominated by someone (I do not know who <gg>), a number of weeks ago and today I received the announcement that I am now an MVP for Windows – SDK for 2007. I’m really thrilled to get the award and I should be getting one of the benefits of the MVP program which is a MSDN subscription in the next few weeks. I’m thinking of setting up some sort of forum or "Ask PJ" section on my web site where you can email me your Windows development related questions and hopefully I should be able to get an answer for you.