Calling FWH from FW16 and update NTX / CDX

Calling FWH from FW16 and update NTX / CDX

Postby Marc Venken » Sat Apr 15, 2017 10:37 am

I have a rather large FW16 project. Looking into it, updating to FWH will be to much work, so I'm looking for a solution to use both.

The FW16 will mainly be used to create the invoices, stock changes, and document for schipping.

I'm more used now with FWH and all new code, functions will be in FWH, espacially statistics, and retrieving common information.

The issue is :

FW16 : I'm using lots of NTX
FWH : I'm using CDX and always Xbrowse (can't do without it :wink: )

The CDX can be created, since It will not effect any NTX files, but when a would change any informatie that affect indexes, the NTX will no longer be correct.

Should I auto-reindex the NTX files after using the FWH program, just to be shure or would you suggest a other way to work with both versions.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Calling FWH from FW16 and update NTX / CDX

Postby Rick Lipkin » Sat Apr 15, 2017 1:25 pm

Marc

I believe you are going to have problems sharing any .dbf that is accessed concurrently with 16 and 32 bit regardless of the index structure. If it were me .. I would spend your time upgrading your fw16 application with Fwh32 and I think you will find new ways and processes you can use to Improve your application to make your legacy code even more powerful.

I know that idea sounds daunting .. but I started with FW some 20 years ago and I had to cross the 16 to 32 bit upgrade myself .. I found new ways to do things including moving all my dbf\cdx tables to Ado and Sql and I never looked back... no more index corruption, no more opportunistic locking problems especially when you write for multi-user programs that run on modern servers.

Just my 2 cents worth ..
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Calling FWH from FW16 and update NTX / CDX

Postby driessen » Sat Apr 15, 2017 5:52 pm

Marc,

I fully agree with Rick.

You'd better get rid of FW16 since these applications can't be run anymore on the current PC because they are 64-bits.

You should also transfer from NTX to CDX. Much faster and much more stable.

And finally converting a FW16 application to FWH is not that hard.

I have 2 huge applications which I transferred to FWH in 2 days time.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Calling FWH from FW16 and update NTX / CDX

Postby Marc Venken » Sun Apr 16, 2017 8:37 am

I know, I know, ..... I should convert :oops:

I looked the last half year into FWh Codes, samples, Xbrowses, ..... and much more.

Almost none of these functionalities are inside the FW16 version.

In fact, I would almost better start a new project for it, because I know so much more now.

First, I have a hard time simply to try to compile with FWH. I have to write a link file for it, but the old 16 one has lots of prg, libs, and obj.
If I convert, I would almost be sure that all functions that uses older libs, objs, can be removed. I rather remake some functions in new FWH style.

In the FW16 version, TSbrowse6 = dominant, just like Xbrowse will become in my FWH version.

But first how should my Link file for FWH look like if would try to compile from FW16 to FWH.

Best way to go :
1. Create a complete link file for FWH
2. Try to compile and see what happens (commend out obsolete functions or remove to a oldfunction.prg)
3. I wount be error free, but finaly I need to get it free
4. convert ntx to cdx logic
5. Update to new FWH logic.

Here is my link and make file. (I have a ndmake.exe file to create the exe)

Maveco.lnk

Code: Select all  Expand view

## BLINKER EXECUTABLE NODELETE
BLINKER INCREMENTAL OFF
BLINKER CLIPPER SYMBOL ON
BLINKER EXECUTABLE CLIPPER F220
packdata
packcode
##noextdic

fi maveco

#FI functies,afdruk,ingeven,klanten,lever,artikel,statistiek,dagtaak,Users,prosp,Makefile,index,finddata,browsers
FI functies,afdruk,ingeven,klanten,lever,artikel,statistiek,dagtaak,Users,prosp,Makefile,index,finddata,browsers
fi tsmtp,tsocket,tphdial
fi errsysw
fi wbrowse,wbrwline,tget,scrllbar,TSbrowse      #  Ts 6 bugfix
#fi wbrowse,wbrwline,tget,scrllbar                       #  Ts 6
#fi cm52,cmx52,cmxdbt52
fi alloc,__wait_b
FI gxrteng1.lib
FI gxrteng2.lib
#fi cmxdbt52


lib btnget,Sbrowse

LIB OLE2,super53
search five,fivec,objects
LIB barlib
LIB winapi,clipper,extend,dbfntx,terminal
#lib cmx52
lib cm52,cmx52

DEFBEGIN
   name        Maveco.exe
   description 'Facturatie MAVECO'
   exetype     Windows
   code        preload moveable discardable
   data        preload moveable
   stacksize   14000
   heapsize    12000
   segment     'PLANKTON_TEXT' nondiscardable
   segment     'EXTEND_TEXT'   nondiscardable
   segment     'OM_TEXT'       nondiscardable
   segment     'OSMEM_TEXT'    nondiscardable
   segment     'SORTOF_TEXT'   nondiscardable
   segment     'STACK_TEXT'    nondiscardable
DEFEND

 


makefile

Code: Select all  Expand view
# Compile

OBJS = maveco.obj \
       afdruk.obj \
       functies.obj \
       ingeven.obj \
       klanten.obj \
       lever.obj \
       artikel.obj \
       statisti.obj \
       dagtaak.obj \
       users.obj \
       errsysw.obj \
       prosp.obj\
       tgraph.obj\
       Makefile.obj\
       tsocket.obj\
       tsmtp.obj\
       tphdial.obj\
       TSbrowse.obj\
       index.obj\
       finddata.obj\
       browsers.obj

maveco.exe:  $(OBJS) maveco.lnk makefile
         @blinker  @maveco.lnk

$(OBJS): $*.prg makefile
 clipper $* /n/a/v/q


# clipper $* /q/n/a/v/w > clip.log

#    clipper maveco.prg /w/n/m/i    
#    clipper $* /w/n/m/i
 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Calling FWH from FW16 and update NTX / CDX

Postby Marc Venken » Sun Apr 16, 2017 1:37 pm

Hello,

With this file below and some minor changes, all the files compile and I get a exe file !! (It seems to be to easy)

The exe file, when executed does nothing. I see no dialog. Since almost all dialogs are with resources, and I have no resource build for FWH. the program maybe can't be executed ?
The program is also not seen in the task manager processes.

If I change the maveco.prg (main program) with a working sample file with only the code from the sample, all files are recompiled and a exe file is create. Nothing to see when this program is executed, but the sample should come up i think.

What is still wrong ?

There is current makefile :

Code: Select all  Expand view


#Borland make sample, (c) FiveTech Software 2005-2009

HBDIR=c:\harbour
BCDIR=c:\borland\bcc7
FWDIR=c:\fwharb

 #change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.ch  = $(FWDIR)\include;$(HBDIR)\include;$(BCDIR)\include
.path.C   = .\
.path.RC  = .\

#important: Use Uppercase for filenames extensions, in the next two rules!

PRG =      \
maveco.PRG \
afdruk.PRG \
functies.PRG \
ingeven.PRG \
klanten.PRG \
lever.PRG \
artikel.PRG \
statisti.PRG \
dagtaak.PRG \
users.PRG \
errsysw.PRG \
prosp.PRG\
Makefile.PRG\
tphdial.PRG\
TSbrowse.PRG\
index.PRG\
finddata.PRG\
browsers.PRG


OBJ = $(PRGS:.PRG=.\OBJ)
OBJS = $(OBJ:.\=.\obj\)

PROJECT    : TEST.EXE

TEST.EXE  : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) TEST.res
   echo off
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
   echo $(OBJS), + >> b32.bc

   echo TEST.EXE, + >> b32.bc
   echo TEST.MAP, + >> b32.bc

   echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc

   echo $(HBDIR)\lib\hbrtl.lib + >> b32.bc
   echo $(HBDIR)\lib\hbvm.lib + >> b32.bc
   echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
   echo $(HBDIR)\lib\hblang.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmacro.lib + >> b32.bc
   echo $(HBDIR)\lib\hbrdd.lib + >> b32.bc
   echo $(HBDIR)\lib\rddntx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddfpt.lib + >> b32.bc
   echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\hbdebug.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcommon.lib + >> b32.bc
   echo $(HBDIR)\lib\hbpp.lib + >> b32.bc
   echo $(HBDIR)\lib\hbwin.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcpage.lib + >> b32.bc
   echo $(HBDIR)\lib\hbct.lib + >> b32.bc
   echo $(HBDIR)\lib\png.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcplr.lib + >> b32.bc
   echo $(HBDIR)\lib\xhb.lib + >> b32.bc
   echo $(HBDIR)\lib\hbtip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbzlib.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmzip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbziparc.lib + >> b32.bc
   echo $(HBDIR)\lib\minizip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbpcre.lib + >> b32.bc

   rem Uncomment these two lines to use Advantage RDD
   rem echo $(HBDIR)\lib\rddads.lib + >> b32.bc
   rem echo $(HBDIR)\lib\Ace32.lib + >> b32.bc

   echo $(BCDIR)\lib\cw32.lib + >> b32.bc
   echo $(BCDIR)\lib\uuid.lib + >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\ws2_32.lib + >> b32.bc
   echo $(BCDIR)\lib\wininet.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\shell32.lib, >> b32.bc

   IF EXIST TEST.RES echo TEST.RES >> b32.bc
   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /N /W0 /V /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include
  $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.C.OBJ:
  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
  echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
  $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
  del tmp

#RES-file wordt door COMPRES.BAT aangemaakt
#TEST.RES : ..\RES\TEST.RC
#  $(BCDIR)\bin\brc32.exe -r ..\RES\TEST.RC
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests