go to index

www.fivetechsoft.com

Lenguaje Español

  Products & Services     News     Support     Downloads     Purchase     Links     About Fivetech  

FiveWin for Harbour

FWH is a library for the new Harbour compiler which lets you create true 32 bit applications for Microsoft Windows (Win 95/98, Windows NT, Windows 2000, Windows XP). FWH is almost 100% compatible with other FW versions (FW for CA-Clipper and FW++ for Alaska XBase++).

With FWH you get very small, self contained 32 bit EXEs for Windows without requiring any external DLLs.

FiveTech Software sincerelly believes that Harbour is the xBase of this new millenium: It is Open Source, Free, multi-platform, and self contained - No additional DLL's are required for Windows support. And it is already attracting the attention of most of the important third party manufacturers.

With FWH we include the latest binaries of Harbour itself, for both Microsoft Visual C++ 6.0 and the free Borland C++ 5.5. compilers. We deliver two FWH libraries sets for both 'C' compilers.

With FWH and any of those 'C' compilers, you do not need anything else to create true 32 bit applications. Since you get Harbour, which is Open source code, and with any of those 'C' compilers you also get all the extra tools you need for development: the resource compiler and the linker. Your actual Resource Workshop for 16 bit works perfectly with FWH, or you may use Microsoft Visual Studio resource designer.

Do not be confused about the requirement of a C compiler. Harbour creates the same Pcode as Clipper does, but instead of creating an OBJ file, it creates a C file with the Pcode equivalent registers. This approach gives Harbour the benefit of being an authentic multi-platform compiler, since there is a C compiler available for any possible platform.

Harbour already provides native NTX and CDX drivers. It also includes a specific library to access the free Advantage local driver or a remote access (Client/Server) with NTX and CDX support that you can use in your applications if you want to.

FWH includes:

FWH (email version):

Great Offert, now includes a free copy of EasyReport Personal edition.

Note: FiveTech Software does not charge any money for Harbour and its documentation.

What is FWH?

FWH is a set of commands, classes and functions developed with the objective to obtain the highest power from the Microsoft Windows environment in conjuntion with Harbour, the open source Clipper language compatible compiler (http://www.harbour-project.org).

FWH is a library that you may link to your Harbour built application enabling the use of all these functionalities. This FWH release has been built using Borland C/C++ 5.5 free compiler (http://cc.codegear.com/Free.aspx?id=24778) in order to be used with Harbour also built with the same Borland compiler.

FWH has been developed to keep total compatibility with the original FW Library for Clipper. FiveTech Software offers real compatibility between 16 and 32 bits. Due to this compatibility level both, products share the same manual and ALL the samples we provide.

The set of classes of FWH are completely self contained. FWH provides the needed classes to create MS standard Windows, Dialogboxes, Menus and Buttonbars with the Microsoft Office style, etc. The reasons why FWH has developed its own set of GUI classes are as follows:

These reasons show the enormous importance of using FWH to port your existing Clipper and FW apps to 32 bits. FWH will give you total control over the Microsoft Windows environment, a must for any professional programming company that will allow them to deliver Windows applications that offer modern and updated management solutions.

Installing FWH:

FWH is designed to be used with Harbour, the open source Clipper language compatible compiler available from www.harbour-project.org. Though you may download latest build from that site, we strongly recommend to use the one we provide as it has been tested and it is already built containing its binaries files (harbour.exe) ready to be used. Just click on the provided Harbour installation icon and it will be automatically installed.

FWH comes with its automatic installation process so you just need to select the install icon and you will be prompted for a few details in order to know the desti-nation path and components you wish to install.

As this FWH has specifically been built to be used with Borland C/C++ 5.5 free compiler, it is required that you also install tha Borland compiler on your com-puter.

Borland C/C++ 5.5 free compiler may be downloaded from http://cc.codegear.com/Free.aspx?id=24778. Borland installation is also an automatic process, though once it is completed, you must create the following ascii files: bcc32.cfg and ilink32.cfg and place them at c:\Your_selected_Borland_path\bin. Those files containts are as follows:

bcc32.cfg:

-I"c:\Your_selected_Borland_path\include"
-L"c:\Your_selected_Borland_path\lib"

ilink32.cfg:
-L"c:\Your_selected_Borland_path\lib"

Borland readme file also explains it very clearly.

Using FWH:

Once you have installed Harbour, FWH and Borland C/C++ free compiler, simply go to c:\FWH\SAMPLES directory and review BuildH.bat defined paths to be sure they match with your Harbour and Borland installation selected paths. Then type:

BuildH.bat tutor01

This should call Harbour.exe to compile tutor01.prg, call bcc32.exe to generate the required OBJ, call brc32.exe to generate the resources RES file if exists and finally call ilink32.exe to build the EXE. This whole process is performed in an automatic way from BuildH.bat.

A first Hello World! Windows small dialog should shown on the screen. If not, please review the paths inside BuildH.bat again to asure they are the ones you have selected for your Harbour and Borland compiler installation.

Now, we do recommend to continue testing the different samples we provide on that directory.

To adapt your FW and Clipper make files, simply do the needed modifications inside them as shown inside SAMPLES\BuildH.bat file.

Guidelines for Harbour users:

FWH is contained into two libraries FiveH.lib and FiveHC.lib. Besides these, FWH provides an extensive set of header files (.CH extension) that implements all required xBase commands to create and manage all the different Windows objects.

In our samples directory ' \samples', we provide the file 'BuildH.bat'. This file shows the correct way to compile and link the applications developed with Harbour and FWH.

BuildH.bat:

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

set hdir=c:\harbour\harbour
set bcdir=c:\bcc55\bin
%hdir%\bin\b32\harbour %1 /n /i..\include;%hdir%\include /p %2 %3 > clip.log
@type clip.log
IF ERRORLEVEL 1 PAUSE
IF ERRORLEVEL 1 GOTO EXIT

echo -O2 -e%1.exe -I%hdir%\include -tW %1.c > b32.bc
%bcdir%\bcc32 -M -c @b32.bc
:ENDCOMPILE

IF EXIST %1.rc %bcdir%\brc32 -r %1

echo c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo ..\lib\FiveH.lib ..\lib\FiveHC.lib + >> b32.bc
echo %hdir%\lib\b32\rtl.lib + >> b32.bc
echo %hdir%\lib\b32\vm.lib + >> b32.bc
echo %hdir%\lib\b32\gtwin.lib + >> b32.bc
echo %hdir%\lib\b32\lang.lib + >> b32.bc
echo %hdir%\lib\b32\macro.lib + >> b32.bc
echo %hdir%\lib\b32\rdd.lib + >> b32.bc
echo %hdir%\lib\b32\dbfntx.lib + >> b32.bc
echo %hdir%\lib\b32\debug.lib + >> b32.bc
echo %hdir%\lib\b32\common.lib + >> b32.bc
echo %hdir%\lib\b32\pp.lib + >> b32.bc
echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib, >> b32.bc
IF EXIST %1.res echo %1.res >> b32.bc
%bcdir%\ilink32 -aa -Tpe @b32.bc

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
ECHO

:LINKERROR
%1
rem if exist meminfo.txt notepad meminfo.txt
rem PAUSE * Linking errors *
GOTO EXIT

:SYNTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO Not exist the specified PRG

:EXIT

Please notice the use of Borland bcc32.exe (Borland C/C++ compiler), after calling the Harbour compiler, to generate the apropiate OBJ file to be linked with Borland free ilink32.exe.

Important recommendations:

Please notice that Borland C/C++ 5.5 resources compiler (brc32.exe) requires to be called previously to call ilink32.exe, as the resultant RES file has to be provided to ilink32.exe. BuildH.bat clearly shows its use.

Do not use the Borland Resource WorkShop to save your 32 bit DLLs, it may cor-rupt them. Save your resources as '.RC' (ASCII) files, and then you may use the 'BRC32.exe' resource compiler to convert your resources '.RC' file into a 32 bit DLL using the following:

brc32.exe Resources.rc Resources.dll

If you keep all your resources in a DLL, it will be very easy to save them as an '. RC' file directly from the Resource Workshop, then use that '.RC' to link directly into your '.EXE'. If you decide to keep your resources in an external DLL, FWH provides an empty 32 bit DLL called 'screen32.dll' it is located in the '\dll' subdi-rectory. Copy it to your project directory and rename it with the name you want.

Guidelines for Clipper and FW users:

All that is needed to rebuild you application in 32 bit form is to replace Clipper.exe and Blinker.exe calls with their 32 bit equivalents Harbour.exe, bcc32.exe and ilink32.exe as done from SAMPLES\BuildH.bat. The FW.ch header file automatically detects Harbour use and proceeds to perform the needed conversions. The Harbour.exe compiler keeps compatibility with most of Clipper.exe flags.

The compatibility level of fw source code with the new FWH is practically 100%.

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

set hdir=c:\harbour\harbour
set bcdir=c:\bcc55\bin

%hdir%\bin\b32\harbour %1 /n /i..\include;%hdir%\include /p %2 %3 > clip.log
@type clip.log
IF ERRORLEVEL 1 PAUSE
IF ERRORLEVEL 1 GOTO EXIT

echo -O2 -e%1.exe -I%hdir%\include -tW %1.c > b32.bc
%bcdir%\bcc32 -M -c @b32.bc
:ENDCOMPILE

IF EXIST %1.rc %bcdir%\brc32 -r %1

echo c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo ..\lib\FiveH.lib ..\lib\FiveHC.lib + >> b32.bc
echo %hdir%\lib\b32\rtl.lib + >> b32.bc
echo %hdir%\lib\b32\vm.lib + >> b32.bc
echo %hdir%\lib\b32\gtwin.lib + >> b32.bc
echo %hdir%\lib\b32\lang.lib + >> b32.bc
echo %hdir%\lib\b32\macro.lib + >> b32.bc
echo %hdir%\lib\b32\rdd.lib + >> b32.bc
echo %hdir%\lib\b32\dbfntx.lib + >> b32.bc
echo %hdir%\lib\b32\debug.lib + >> b32.bc
echo %hdir%\lib\b32\common.lib + >> b32.bc
echo %hdir%\lib\b32\pp.lib + >> b32.bc
echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib, >> b32.bc
IF EXIST %1.res echo %1.res >> b32.bc
%bcdir%\ilink32 -aa -Tpe @b32.bc

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
ECHO

:LINKERROR
%1
rem if exist meminfo.txt notepad meminfo.txt
rem PAUSE * Linking errors *
GOTO EXIT

:SYNTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO Not exist the specified PRG

:EXIT

Adapting your C source code:

Harbour requires some minor changes on your own developed C files. We do provide an utility named TOOLS\Clp2Harb.exe that automatically performs those changes. Clp2Harb.exe is a Harbour small application and its source code is provided.

Clp2Harb.exe must be called prior to compile your C files:

Clp2Harb.exe YourFile.c temp\YorFile.c

Clp2harb.exe creates an output file with the name supplied as second parameter with the changes already implemented. Later on you call Borland bcc32.exe with the following syntax:

bcc32 -c TEMP\YourFile.c

Using Borland Custom Controls (Bwcc32.dll):

You have to use bwcc32.dll instead of using bwcc.dll, then:

First load the library as usual:

local hDLL := LoadLibrary( "bwcc32.dll" ) // Notice the 32 use

Then you must call:

BWCCRegister(GetResources())

And finally, before exiting your app, do:

FreeLibrary( hDLL )

And place this at the bottom of your main PRG:

DLL32 FUNCTION BWCCRegister( hInst AS LONG ) AS WORD PASCAL LIB "BWCC32.DLL"

Using Advantage local RDD with Harbour:

Actually you can use Advantage client kit for 32 bits with Harbour to access remote or locally to any DBF file. The remote access is based on the famous Advantage Xbase server which is also available to Clipper (16 bits) users, but the local driver is new to all Clipper users since it does not exist on 16 bits. The local driver acts as a standard RDD against DBF files, so you can use it to devolope your own applications with Harbour. The Advantage RDD suports CDX and NTX formats.

The Advantage local driver DLLs are present on a free software published by Extended Systems on their Web site and fw for Harbour includes the necessary libraries to access to these DLLs.

The link where you can find all the needed DLLs is on Advantage web site , developers resources section. Once there, you will need to register yourself, then you will have access to the Advantage Solutions web site. Then go the download area and select the 5.7/2.7 release section and click to download the file arc.exe. This software includes all the needed libraries which are:

All these files should be placed on the \WINDOWS\SYSTEM directory. In case you have a Advantage Database server then you will only need ACE32.DLL and AXCWS32.DLL

To use the Advantage RDD from your Harbour applications you just need to do the following:

This is a little sample

// fw Quick browses feature sample

#include "fw.ch"
#include "ads.ch"
REQUEST _ADS

//----------------------------------------------------------------------------//

function Main()

rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )

SET SERVER LOCAL
SET FILETYPE TO CDX

USE Clientes // Open any DBF...

OrdSetFocus("DIRECCION") // Second Tag on Clientes.cdx
go top

Browse() // Quick browse!!!

USE

return nil

//----------------------------------------------------------------------------//

We highly recommend to use the Advantage remote Xbase Server from Extended Systems