FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Converting POS application to xHarbour + FWH
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to xHarbour + FWH
Posted: Fri Aug 17, 2007 06:57 PM

Hi all,

Is there a way we can get a list of memvars with Clip52 and FW24 at run time?

Thanks in advance,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Converting POS application to xHarbour + FWH
Posted: Sat Aug 18, 2007 07:37 AM

Jose,

Do you mean all memvars: static, public, private, locals ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to xHarbour + FWH
Posted: Mon Aug 20, 2007 02:58 PM

Yes.

Thanks,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Converting POS application to xHarbour + FWH
Posted: Mon Aug 20, 2007 05:40 PM

Jose,

locals and statics have no name, just their value based in their position.

There should be a way to get the publics and private names.

Anyhow, why don't you port your application to Harbour/xHarbour and FWH ? There we have full access to all that information.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to xHarbour + FWH
Posted: Tue Aug 21, 2007 02:47 PM

Antonio,

Thank you for the hint.

We like to try to port our application to xharbour + FWH. The problem was there are several C codes with our POS application and there is a missing print.h. We are not sure how significant the file print.h.

Regards,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Converting POS application to xHarbour + FWH
Posted: Tue Aug 21, 2007 09:22 PM

Jose,

What do you use print.h for ? Please look for the C module that uses it, comment it out (the header file) and compile to see what errors you get.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to xHarbour + FWH
Posted: Wed Aug 22, 2007 09:23 PM

Antonio,

I am using XHB and have difficulties copying the error code. Here's the C code instead.

Thank you,

Jose

define Escape _Escape

include <Windows.h>

include <Print.h>

define __WINDOWS_H

/#include <d:\dev\fw192\include\ClipApi.h>/

include <ClipApi.h>

CLIPPER RAWPRINT() // ( hDC, cText ) --> nBytesSent
{
LPBYTE lpbData;
LPWORD lpwLength;
if (PCOUNT()==2 && ISNUM(1) && ISCHAR(2))
{
// Create a buffer 2 bytes larger that length of cText
lpbData = _xgrab(_parclen(2)+2);
if (lpbData)
{
lpwLength = (LPWORD)lpbData;
// First WORD (16 bits, 2 bytes) contains the number of bytes of input data
*lpwLength = _parclen(2);
// Data starts at 3rd byte, copy cText to data
_bcopy(lpbData+2,_parc(2),_parclen(2));
// Return nBytesSent, failure if nBytesSent<=0
_retni(Escape(_parni( 1 ),PASSTHROUGH,NULL,(LPSTR)lpbData,NULL));
// Free memory!
_xfree(lpbData);
}
else
_retni(0); // No memory!
}
else
_retni(0); // Invalid args!
}

Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to xHarbour + FWH
Posted: Wed Aug 22, 2007 11:02 PM

Antonio,

>What do you use print.h for ?

No idea, we just purchased the source code.

Thanks,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Converting POS application to xHarbour + FWH
Posted: Wed Aug 22, 2007 11:54 PM

Jose,

Make this change in the C code and try to compile it again:

ifndef FLAT

include <Print.h>

endif

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to XHarbour + FWH
Posted: Sun Mar 30, 2008 05:38 AM

Antonio,

I'm still getting a type mismarch at line 27:
Actual compiler error: Type mismatch in parameter 1 (wanter 'HDC__*', got 'int') in function RAWPRINT.

Hopefully I can convert it this time.

Thanks,

Jose

Here's the code below:

define Escape _Escape

include <Windows.h>

//**#include <Print.h>

ifndef FLAT

#include <Print.h>

endif

define __WINDOWS_H

//*#include <d:\dev\fw192\include\ClipApi.h>

include <c:\fwh\include\ClipApi.h>

CLIPPER RAWPRINT() // ( hDC, cText ) --> nBytesSent
{
LPBYTE lpbData;
LPWORD lpwLength;
if (PCOUNT()==2 && ISNUM(1) && ISCHAR(2))
{
// Create a buffer 2 bytes larger that length of cText
lpbData = _xgrab(_parclen(2)+2);
if (lpbData)
{
lpwLength = (LPWORD)lpbData;
// First WORD (16 bits, 2 bytes) contains the number of bytes of input data
lpwLength = _parclen(2);
// Data starts at 3rd byte, copy cText to data
_bcopy(lpbData+2,_parc(2),_parclen(2));
// Return nBytesSent, failure if nBytesSent<=0
_retni(Escape(_parni( 1 ),PASSTHROUGH,NULL,(LPSTR) lpbData,NULL)); <---
Note: The error looks like at this line ****
// Free memory!
_xfree(lpbData);
}
else
_retni(0); // No memory!
}
else
_retni(0); // Invalid args!
}

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Converting POS application to xHarbour + FWH
Posted: Sun Mar 30, 2008 09:03 AM

Jose,

Change this:
_retni(Escape(_parni( 1 ), ...

into this:
_retni(Escape( ( HDC ) _parni( 1 ), ...

if you plan to port it to 32 bits, then better use:
_retnl(Escape( ( HDC ) _parnl( 1 ), ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Porting POS application to 32bit (x)Harbour + FWH
Posted: Sun Mar 30, 2008 09:54 PM

Antonio,

The C source codes looks like compiled but there are some unrsolved functions.

Is there a way we can resolve the following functions in (x)HB/FWH?

Thanks,

Jose

Unresolve Functions:

uoutportb
ninportb
bin_or
bin_not
ipc_dStat
tecdrwopen
drw_ipc
dsp_ipc
dsp_tec
ipc_key
set_ram
read_ram
cmxsipuniqu
getkeystat
wmcopydata
getworkrect
onwmcopydata
connect1
recv1
cmxautoopen
cmxsys
createwinex
rawprint
getcomstat
cmxsetscope
comix

For more info. Here's the Clipper link script:

BLINKER HOST PASSUP OFF

BLINKER INCREMENTAL OFF

BLINKER EXECUTABLE COMPRESS 1

BLINKER CLIPPER SYMBOL OFF

PACKCODE
PACKDATA

MAP=EXE\52\PCREGW.MAP S,A

DEFBEGIN
name PCREGW
description 'PC/Register'
exetype Windows 3.1
code preload moveable discardable
data preload moveable
stacksize 10000
heapsize 2000
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

NOBELL

FILE ADDALIAS, ADDNDX, ALTC, AREA1, AREA1_A, AREA1_B,
AREA1_C, AREA1_D, AREA1_DB, AREA2, AREA2_A, AREA2_B,
AREA2_C, AREA2_C2, AREA2_D, AREA2_E, AREA2_F, AREA2_H,
AREA3, AREA3_A, AREA3_B, AREA3_C, AREA4, AREA4_A,
AREA4_B, AREA4_C, AREA4_D, AUTHCOMM, AUTHSUP, AUTHTRAN,
BATCHADM, CL_IPC, CL_PORTB, CONCORD,
ENOUGH, FDBF, FEXPFILE,
FLIVE, FMULTI, FPAD, FPCJOUR, FRENLAR, FRENCFG, FSCALE,
FSUSPEND, FTAXRAM, FTXTVIEW, FUNIQUE, FUSEFILE, GENIO, GETPSW,
GETSERI, GO, HARDWARE, IBM4694W, IBMSUP, ICSETUP, ICVERIFY,
LUHN, MODE, OPENFILE, OPENSUSP, PCLW, PHYSICAL, PINPAD,
PLU_FUNC, PRINTCFG, REGSETUP, RFLINE, ROOT, SCANNER, SHELL, TIMER, VERSION,
JRNARCHV,LS_ALERT,LS_funcs,LS_ODBC,LS_rcTrx

Platform specific

FILE CAPFIRST, CCOMM,
CCOPYDAT, CBUTTON, CDIALOG, CGET, CHTML, CPCREG, CRECT, CSHIFT4, CSTREAM, CWINDOW,
DATASHET, ERRSYSW, HANDY,
NOCOLOR, NOTECSUP,
RAWPRINT, TELEPATH,
TGET,
XTIMER

FILE COPYDATA, COMSTAT
nodeflib

Modified DBCMD1 from CLIPPER.LIB version 5.2e

FILE DBCMD1, DBFT

Comix RDD

FILE cmx52, cmxFox52
LIB cmx52
@cmx.lnk

Telepathy extraction from TPOVL52.LIB

FI TPBIN

Clipper extraction from Clipper.Lib ver 5.3, Fivewin recommends using

FI ALLOC, MEMORY

After adding blxclp52, Clipper Internal Error - Unrecoveralbe error 332 is now traceable

and under windows xp - the error "§ caused an access violation in CUI.EXE at 0x77f57aec."

now only appears when application exits and not at startup.

FI \DEV\BLI5\OBJ\BLXCLP52

Blinker fix for Clipper Windows applications accross 32k boundaries

FI \DEV\BLI5\OBJ\MPAR

LIB Five, FiveC, Objects, WinApi, Clipper, Extend, Terminal

RC WINDOWS\PCREG.RES
RC WINDOWS\KEYBOARD.RES

Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Porting application to (x)Harbour + FWH
Posted: Mon Mar 31, 2008 01:38 AM

Antonio,

Functions uOutPortB and nInPortB are in C source codes but they are unresolved.

Regards,

Jose

/
ÚÄ Clipper Header ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ File Name: CL_PORTB.C ³
³ Description: ³
³ Author: George Hanson ³
³ Date created: 10-27-95 Date updated: þ10-27-95 ³
³ Time created: 04:34:03pm Time updated: þ04:34:03pm ³
³ Copyright: (c) 1995, AIM Systems ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
/
/*

ifndef LARGE

#error Must be large memory model.

endif

*/

include <extend.api>

include <dos.h>

CLIPPER uOutPortB( )
{
unsigned int nPort, nValue;

nPort = _parni( 1 );
nValue = _parni( 2 );
outportb( nPort, nValue );
_ret( );
}

CLIPPER nInPortB( )
{
unsigned int nPort;

nPort = _parni( 1 );
_retni( inportb( nPort ) );
}

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Converting POS application to xHarbour + FWH
Posted: Mon Mar 31, 2008 08:06 AM

José,

> Functions uOutPortB and nInPortB are in C source codes but they are unresolved.

Win32 does not allow you to directly manage the communication ports using outportb() and inportb(). You have to use the Win32 comm management functions.

Please review fwh\samples\TestComm.prg and phone.prg also

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 100
Joined: Wed Oct 04, 2006 04:50 PM
Converting POS application to xHarbour + FWH
Posted: Wed Apr 09, 2008 10:08 PM

Antonio,
I have two questions so far.

  1. Do we have equivalent function for uoutportB and nInportB in FW where we can make a wrapper function for our application.

  2. How do we force 10 characters for Identifiers in (x)harbour?

thanks,

Jose