Archive

Archive for July, 2007

PStat v1.24

July 23, 2007 Comments off

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

  • Updated copyright details.
  • Optimized CProgressThreadDlg constructor code.
  • CProgressThreadInfo is now no longer derived from CObject as it was not really required.
  • Code now uses newer C++ style casts instead of C style casts.
  • Addition of a CPROGRESSTHREADDLG_EXT_CLASS preprocessor macro to make the code easier to use in an extension dll.
  • Restructured code to avoid need for internal CProgressThreadInfo class.
  • Made the Cancel button’s ID on the IDD_PSTAT_PROGRESS_WITH_CANCEL "IDCANCEL".
  • Code now internally thread protects the "m_bCancelled" and "m_bOkToClose" member variables.
  • FUNCTION_WITH_PROGRESS function is now declared as PSTAT_FUNCTION and returns a void. It is also now scoped in the CProgressThreadDlg class.
  • Updated sample app to clean compile on VC2005.
  • Updated the documentation to use the same style as the web site.
Advertisement
Categories: Web Site Updates

Splasher v1.47

July 22, 2007 4 comments

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

  • Updated copyright details.
  • Optimized CSplashFactory constructor code
  • CSplashWnd code now uses WM_NCHITTEST logic to support a draggable splash screen
  • Made Create and Close methods in CSplashFactory virtual
  • CSplashFactory::Create now waits for the worker thread’s InitInstance to complete
  • Removed unnecessary VERIFY call from CSplashWnd::Create
  • CSplashWnd::CreatePaletteFromBitmap now returns a BOOL
  • Removed the unnecessary CSplashWnd destructor
  • Removed the unnecessary CSplashThread destructor.
  • Reviewed all TRACE statements for correctness
  • Removed unnecessary use of friend classes
  • Updated sample apps to clean compile on VC2005
Categories: Web Site Updates

CToasterWnd v1.11

July 21, 2007 Comments off

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

  • Updated usage instructions about Platform SDK.
  • The CToasterNotification notifier interface has been extended to support a "OnHTMLayoutLoadData" method. This allows client code to customize the loading of data when using the HTMLayout control without the need to implement a derived class of CToasterWnd. Thanks to Itamar Syn-Hershko for reporting this suggestion.
  • OnHTMLLayoutHyperLink method in CToasterNotification has been renamed to OnHTMLayoutHyperLink
  • OnHTMLLayoutCommand method in CToasterNotification has been renamed to OnHTMLayoutCommand
Categories: Web Site Updates

CPJNPOP3Connection v1.40

July 21, 2007 Comments off

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

  • Updated copyright details
  • CPJNPOP3Connection::Connect, Delete, Statistics, List, UIDL, Reset, Noop and GetMessageHeader methods now catch CWSocketException exceptions and rethrow them as CPJNPOP3Exception exceptions. This allows client code to only expect CPJNPOP3Exception exceptions to be thrown from the class. Thanks to Alexey Kuznetsov for reporting this issue.
Categories: Web Site Updates

OpenSSL Compilation on Win32

July 7, 2007 7 comments

Following on from my "Common problems compiling my code" blog entry, another popular email question I get is related to my SMTP class is problems related to getting OpenSSL support compiled into the class. Here’s a snippet from the OpenSSLMfc.h header file which provides a simple encapsulation of a socket connection using OpenSSL:

#include <openssl\ssl.h> //If you get a compilation error about this missing header file, then you need to download OpenSSL from http://www.openssl.org and build a Win32 version and incorporate it into Visual C
#include <openssl\err.h> //If you get a compilation error about this missing header file, then you need to download OpenSSL from http://www.openssl.org and build a Win32 version and incorporate it into Visual C
#include "SocMFC.h"

As you can see it references the OpenSSL header files "ssl.h" and "err.h". You can download OpenSSL directly as the code comments mention above from http://www.openssl.org. As of 7th of July 2007, the latest version of OpenSSL is 0.9.8e. Once you have downloaded OpenSSL you should read and follow the build instructions in the file INSTALL.W32 included in the OpenSSL download. Basically the steps are:

  1. You will need to have Perl for Win32 installed. If you do not have it you can download ActiveState Perl from http://www.activestate.com/ActivePerl
  2. Bring up a Visual Studio command prompt, navigate to the OpenSSL install directory (say c:\some\openssl) and run Configure as follows:
    perl Configure VC-WIN32 –prefix=c:/some/openssl/dir
    This assumes that you have setup perl to be in your search path
  3. Assuming you do not want to mess about with assembly language, type ms\do_ms from your command prompt. Examine the window for any errors.
  4. Then type nmake -f ms\ntdll.mak which will actually perform the compile and link of the OpenSSL code. This may take a while. When it finishes examine the out32dll directory which should contain the OpenSSL DLLs and executables. Note that by default this will only produce "release" mode binaries and you need to manually edit and rerun the make process if you want to create "debug" binaries. Also to avoid the "debug" binaries overwritting the already created "release" binaries, you need to edit the make file or backup the existing binary files. Basically this step is a bit of a mess to get right!
  5. Point your copy of VC to the appropriate Include and Lib directories. In our example this would be "c:\some\openssl\inc32" and "c:\some\openssl\out32dll" respectively. If you are using Visual Studio 2005, this would be using the menu item "Tools -> Options -> Projects and Solutions -> VC++ Directories -> "Include Files" & "Library Files"
  6. Update your project linker settings to link to the correct OpenSSL libraries. This will normally be ssleay32.lib libeay32.lib for release mode builds.

If all of the steps above prove to be too much work, then a company called Shining Light Productions have very kindly packaged up the end results of all this work into a nice and simple installation package for us Windows developers.

  1. You can download the Win32 OpenSSL Installation Project from http://www.slproweb.com/products/Win32OpenSSL.html. As of 7th of July 2007, you can download either OpenSSL v0.9.8e and v0.9.7m. Both of these are the most recent builds from each stream of OpenSSL. When you install the download on your machine, you end up with the static import libraries in a "Lib\VC\static" directory below the install directory, the DLL import libraries in a "Lib\VC" directory and the main include files in a "include" directory (again both below the install directory). The download a new developer to OpenSSL should select is the "Win32 OpenSSL v0.9.8e download" link.
  2. To complete the integration with VC, setup the Include and Lib directories as in Step 5 above. Assuming you installed the Win32 OpenSSL project into C:\dev\openssl-0.9.8e, you would add "c:\dev\openssl-0.9.8e\include" to the Include setting and "C:\dev\openssl-0.9.8e\lib" to the Lib setting in VC.
  3. You need to link to the correct import library depending on how you build your code. 8 different DLL import lib files are provided in the Lib\VC directory and a further 8 in the Lib\VC\Static directory. The 2 OpenSSL libraries namely libeay and ssleay each come in 4 varieties with the Win32 OpenSSL Project, resulting in 8 DLL import libraries and 8 static import libraries. These are:

    libeay32MD.lib
    libeay32MDd.lib
    libeay32MT.lib
    libeay32MTd.lib
    ssleay32MD.lib
    ssleay32MDd.lib
    ssleay32MT.lib
    ssleay32MTd.lib

    Which ones you use depend on how you are building your client project and its use of the VC runtime. For more information see http://msdn2.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx. The differences basically correspond to whether you want to use the VC runtime DLL or statically embed the VC runtime in your application.

Hopefully this info will help you get up and running with OpenSSL and my SSL classes in your own code.

Happy coding!

Categories: Programming

CSelectCertificateDlg v1.01

July 5, 2007 Comments off

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

  • Updated copyright messages.
  • Updated the sample app to clean compile on VC 2005.
  • Addition of a CSELECTCERTIFICATEDLG_EXT_CLASS preprocessor macro which makes the class easier to use in an extension dll.
Categories: Web Site Updates

EnumSerialPorts v1.16

July 5, 2007 1 comment

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

  • Updated the code to work if the code does not include MFC. In this case, CUIntArray parameters becomes the ATL class CSimpleArray<UINT> and CStringArray parameters become the ATL class CSimpleArray<CString>. Please note that this support requires a recentish copy of Visual Studio and will not support Visual C++ 6.0 as the code makes use of the ATL CString class. Thanks to Michael Venus for prompting this update.
  • CEnumerateSerial::UsingWMI method now uses ATL smart pointers to improve robustness of the code.
Categories: Web Site Updates

AppSettings v1.04

July 5, 2007 2 comments

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

  • Added support for "Pretty Printing" to the CXMLAppSettings class. This is achieved through an additional parameter to the constructor.
Categories: Web Site Updates