Back to the WFC main page

WFC Technical Note 2 - Installing WFC

$Revision: 2 $ Last Modified $Date: 9/21/98 7:57a $

Introduction

Now that you've downloaded the most popular freeware MFC extension library in the world, you probably want to use the thing.

Unpacking

WFC.ZIP contains only one file, WFC.TAR. If you have a tool called WinZip, it will expand both these files. Here's the step by step method that I use to unpack WFC.
  1. Copy WFC.ZIP to C:\TEMP
  2. Unzip WFC.ZIP to produce WFC.TAR
  3. Make a directory where WFC will exist
  4. Change into that directory
  5. Expand the WFC.TAR file
Here's the closest thing to an install script:
C:
cd \
cd temp
copy a:\wfc.zip
unzip wfc.zip
cd \
mkdir wfc
cd wfc
pax -r <c:\temp\wfc.tar

Hooking Into DevStudio

Now that WFC has been installed on the hard drive, we must build it before we can get some work done. To make life easier, we will make DevStudio aware of WFC's existence. To do this, we must tell DevStudio where to look for files.

Add WFC to the Include Directories

Click on the following menu items: Select "Include files" in the "Show directories for" combobox. You will see a list of directories used to find header files. Double click on the gray box in the edit control to add another directory to the list. Add C:\WFC\Include to the list.

Add WFC to the Library Directories

Click on the following menu items: Select "Library files" in the "Show directories for" combobox. You will see a list of directories used to find library files. Double click on the gray box in the edit control to add another directory to the list. Add C:\WFC\Lib to the list.

Add WFC to the Source Directories

Click on the following menu items: Select "Source files" in the "Show directories for" combobox. You will see a list of directories used to find source code files. Double click on the gray box in the edit control to add another directory to the list. Add C:\WFC\src to the list.

Pre-Build Bug Fixing

Before we build the WFC library, we must fix a Microsoft bug. I know, you are shocked to find out that Microsoft has a bug in one of their products. Well, Microsoft is human and we all make mistakes. The bug lies in the Project file for WFC (WFC.DSP). DevStudio never updates this file for some reason. Here's what we must do to correct the problem. I don't know what's going on in there but I think it is part of some orphaned code or something. All I know is, when I build WFC (on machines other than the original WFC machine) without these changes, the E: drive is accessed. This is really annoying when E: happens to be a Jaz drive that has spun down. It is even more annoying when a Jaz cartridge isn't in the drive and DevStudio refuses to build WFC until you put one in.

Building WFC

Now that WFC source code is installed and a bug is fixed, we must build the library. Here's how to do just that from the DevStudio main menu: Whew! This will build the Release build of WFC. You can select the other configurations and build them too.

Using WFC

Now that WFC has been installed and built, it is time to use it. All you should have to do is put #include <wfc.h> in your header file. WFC takes care of including the proper version of the library (ASCII or UNICODE, Debug or Release) at link time. To find out how this is done, read the wfc.h file. Here's sample test program that should help. You should create a new Win32 Console Application and have this code compile and run.
#include <wfc.h>
#pragma hdrstop

int _tmain( void )
{
   CString version_string;

   wfc_get_operating_system_version_string( version_string );

   _tprintf( TEXT( "%s" ), (LPCTSTR) version_string );
}


Samuel R. Blackburn