Converting POS application to xHarbour + FWH
Converting POS application to xHarbour + FWH
Hi all,
Is there a way we can get a list of memvars with Clip52 and FW24 at run time?
Thanks in advance,
Jose
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.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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!
}
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!
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Converting POS application to XHarbour + FWH
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!
}
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!
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Porting POS application to 32bit (x)Harbour + FWH
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
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
Porting application to (x)Harbour + FWH
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 ) );
}
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 ) );
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: