Page 1 of 1

Migration to 32 bits

Posted: Wed Jun 21, 2006 5:51 pm
by Greg Gammon
I am just now getting back into updating programs that I have been using now for 5-6 years. Im on FiveWin 2.0/clipper and am wondering about any advantage to moving to Harbour 32 bits. How transportable is the code...will I have to do much in the way of re-writing code? Thanks in advance!

Posted: Wed Jun 21, 2006 11:06 pm
by Antonio Linares
Greg,

You can port your FW+Clipper applications to 32 bits FWH+Harbour/xharbour ones, in record time. The compatibility level is very high, almost 100%, except for some operations that may not be allowed by the operating system (low level interrupts, VBXs management, etc). You can have your apps in 32 bits in one or two weeks.

32 bits applications provide a much better integration with Windows XP and next Windows Vista too. There are no memory limitations, so applications are more stable. Better integration with Windows drivers (printers and other devices).

thanks

Posted: Wed Jun 21, 2006 11:35 pm
by Greg Gammon
Antonio....thanks for the info.

Im having a particular problem with printing forms to different printers in our network from certain Win98 machines. Reading some other threads it appears there are growing compatibility issues with print drivers so I assume to correct these issues I really need to move quickly to 32bits??

To make the jump, please outline exactly what I need to purchase to make the transition. Thanks again!

Posted: Thu Jun 22, 2006 7:07 am
by Antonio Linares
Greg,

Yes, there are some printers drivers that just properly work when used from a 32 bits application.

The product you need is FWH (FiveWin for Harbour). You may order it from https://secure.fivetechsoft.com/english/purchase.html

You get all you need for a real quick move to 32 bits.

Posted: Mon Jun 26, 2006 7:07 am
by Badara Thiam
Antonio,

Can you give me a sample of printer driver who need 32 bits
applications to work properly, because i have found not any.

Thanks,

Posted: Mon Jun 26, 2006 8:36 am
by Antonio Linares
Badara,

We can't tell you right now an exact printer model, but we have been reported through several years about printers that were not properly working under 16 bits, most of them USB printers.

Posted: Mon Jun 26, 2006 1:59 pm
by Greg Gammon
The particular issue I have found with my 16bits application is this...
First, the setup - We select two different printers to print to for different size forms we produce and this is done in the program setup and stored so that you automatically print to the correct printer when you select a certain form.
This all works well on our XP and 2000 machines, but in 95 and 98, it will cause the program to crash (GPF) when printing to any printer OTHER than the windows default printer.

I assume this will be a moot point as I migrate on to 32bits. BTW Antonio, I got FHW installed and re-compiled my program on the 1st run!!! That NEVER happens...laugh. I have found just a few run-time bugs to fix but overall it seems like it will be a simple migration. Kudos!

Greg

Posted: Mon Jun 26, 2006 11:29 pm
by Antonio Linares
Greg,

Glad to know you are moving forward :)

Posted: Tue Jun 27, 2006 8:19 am
by Badara Thiam
Antonio Linares wrote:Badara,

We can't tell you right now an exact printer model, but we have been reported through several years about printers that were not properly working under 16 bits, most of them USB printers.
Antonio,

My users and me have no problem with USB printers, with Fivewin 16 bits for Windows like with pure Clipper DOS via PageScript.

The Fivewin print system need to upgrade to work fine, much functions
called are obsoletes and some functions causes GPF. I think you could
see here the reals problems found several years ago, not in the 16 bits applications. 16 bits is not the cause of this, i verify that alls the days !

Regards,

Posted: Wed Jun 28, 2006 10:27 am
by Antonio Linares
Badara,

> The Fivewin print system need to upgrade to work fine,

We appreciate if you share such upgrade details with us. Thanks,

Posted: Thu Jun 29, 2006 8:19 am
by Badara Thiam
Antonio,

Here is a part of Fivewin 2.5 PRINTER.PRG file, the method New() :

Code: Select all

METHOD New( cDocument, lUser, lMeta, cModel, lModal ) CLASS TPrinter

   local aOffset
   local cPrinter

   DEFAULT cDocument := "FiveWin Report" ,;
           lUser     := .f.              ,;
           lMeta     := .f.              ,;
           lModal    := .f.

   if lUser
      ::hDC := GetPrintDC( GetActiveWindow() )
      if ::hDC != 0
         cModel := ::GetModel()+","+::GetDriver()+","+::GetPort()
      endif
   elseif cModel == NIL
      ::hDC  := GetPrintDefault( GetActiveWindow() )
      if ::hDC != 0
         cModel := ::GetModel()+","+::GetDriver()+","+::GetPort()
      endif
   else
      cPrinter := GetProfString( "windows", "device" , "" )
      WriteProfString( "windows", "device", cModel )
      SysRefresh()
      PrinterInit()
      ::hDC := GetPrintDefault( GetActiveWindow() )
      SysRefresh()
      WriteProfString( "windows", "device", cPrinter  )
   endif

   if ::hDC != 0
      aOffset    := PrnOffset( ::hDC )
      ::nXOffset := aOffset[1]
      ::nYOffset := aOffset[2]
      ::nOrient  := ::GetOrientation()
   elseif ComDlgXErr() != 0
      MsgStop( "There are no printers installed!"  + CRLF + ;
               "Please exit this application and install a printer." )
      ::nXOffset := 0
      ::nYOffset := 0
   endif

   ::cDocument  := cDocument
   ::cModel     := cModel
   ::nPage      := 0
   ::nPad       := 0
   ::lMeta      := lMeta
   ::lStarted   := .F.
   ::lModified  := .F.
   ::lPrvModal  := lModal

   if !lMeta
      ::hDcOut := ::hDC
   else
      ::aMeta  := {}
      ::cDir   := GetEnv("TEMP")

      if empty(::cDir)
         ::cDir := GetEnv("TMP")
      endif

      if Right( ::cDir, 1 ) == "\"
         ::cDir = SubStr( ::cDir, 1, Len( ::cDir ) - 1 )
      endif

      if !empty(::cDir)
         if !lIsDir(::cDir)
            ::cDir := GetWinDir()
         endif
      else
         ::cDir := GetWinDir()
      endif

   endif

return Self

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



I never use GetPrintDC().
Below is my method New() for class TPrinter() :

Code: Select all

METHOD New( cDocument, lUser, lMeta, cModel, lModal) CLASS TPrinter

   local aOffset
   local cPrinter
   LOCAL cPortDrv

   DEFAULT cDocument := "Impression ICIM" ,;
           lUser := .f. , ;
           lMeta := .f. , ;
           lModal := .f.


   IF cModel = NIL
     cModel := WinDefPrn()
   ENDIF
   cPortDrv := WinGetPrnP(cModel)
   cModel := cModel + "," + cPortDrv
   SysRefresh()


   ::hDC := CreateDC( TOKEN(cModel,",",2), ;
   TOKEN(cModel,",",1), TOKEN(cModel,",",3))
   SysRefresh()

   if ::hDC != 0
      aOffset    := PrnOffset( ::hDC )
      ::nXOffset := aOffset[1]
      ::nYOffset := aOffset[2]
      ::nOrient  := ::GetOrientation()
   elseif ComDlgXErr() != 0
      MsgStop( OemToAnsi("Aucune imprimante n'est installée ou accessible actuellement...") )
      ::nXOffset := 0
      ::nYOffset := 0
   endif

   ::cDocument  := cDocument
   ::cModel     := cModel
   ::nPage      := 0
   ::nPad       := 0
   ::lMeta      := lMeta
   ::lStarted   := .F.
   ::lModified  := .F.
   ::lPrvModal  := lModal

   if !lMeta
      ::hDcOut := ::hDC
   else
      ::aMeta  := {}
      ::cDir   := GetEnv("TEMP")

      if empty(::cDir)
         ::cDir := GetEnv("TMP")
      endif

      if Right( ::cDir, 1 ) == "\"
         ::cDir = LEFT( ::cDir, LEN( ::cDir ) - 1 )
      endif

      if !empty(::cDir)
         if !lIsDir(::cDir)
            ::cDir := GetWinDir()
         endif
      else
         ::cDir := GetWinDir()
      endif

   endif

return Self



See my last contributions to find source code of WinDefPrn()
and WinGetPrnP().

I suggest to delete all calls of theses functions :

PrinterInit(), GetModel(), GetDriver(), GetPort(), GetPrintDefault()
All functions who call theses functions need to be rewritted,
or rewritte theses functions.

Delete also all read-write in .ini files to manage printers.

Posted: Fri Jun 30, 2006 7:04 am
by Antonio Linares
Badara,

Thanks,