Converting POS application to xHarbour + FWH

Converting POS application to xHarbour + FWH

Postby xhbcoder » Fri Aug 17, 2007 6: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
Last edited by xhbcoder on Sun Mar 30, 2008 5:41 am, edited 1 time in total.
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Sat Aug 18, 2007 7:37 am

Jose,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Mon Aug 20, 2007 2:58 pm

Yes.

Thanks,

Jose
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Mon Aug 20, 2007 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Tue Aug 21, 2007 2: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
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Tue Aug 21, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Wed Aug 22, 2007 9: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!
}
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby xhbcoder » 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
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Converting POS application to XHarbour + FWH

Postby xhbcoder » Sun Mar 30, 2008 5: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!
}
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Sun Mar 30, 2008 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Porting POS application to 32bit (x)Harbour + FWH

Postby xhbcoder » Sun Mar 30, 2008 9: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
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Porting application to (x)Harbour + FWH

Postby xhbcoder » Mon Mar 31, 2008 1: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 ) );
}
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Mon Mar 31, 2008 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » 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
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Next

Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 6 guests