Hi all,
Is there a way we can get a list of memvars with Clip52 and FW24 at run time?
Thanks in advance,
Jose
Hi all,
Is there a way we can get a list of memvars with Clip52 and FW24 at run time?
Thanks in advance,
Jose
Jose,
Do you mean all memvars: static, public, private, locals ?
Yes.
Thanks,
Jose
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.
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
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.
Antonio,
I am using XHB and have difficulties copying the error code. Here's the C code instead.
Thank you,
Jose
/#include <d:\dev\fw192\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,
>What do you use print.h for ?
No idea, we just purchased the source code.
Thanks,
Jose
Jose,
Make this change in the C code and try to compile it again:
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:
//**#include <Print.h>
#include <Print.h>
//*#include <d:\dev\fw192\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!
}
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 ), ...
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 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
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
FILE DBCMD1, DBFT
FILE cmx52, cmxFox52
LIB cmx52
@cmx.lnk
FI TPBIN
FI ALLOC, MEMORY
FI \DEV\BLI5\OBJ\BLXCLP52
FI \DEV\BLI5\OBJ\MPAR
LIB Five, FiveC, Objects, WinApi, Clipper, Extend, Terminal
RC WINDOWS\PCREG.RES
RC WINDOWS\KEYBOARD.RES
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 ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
/
/*
#error Must be large memory model.
*/
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 ) );
}
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
Antonio,
I have two questions so far.
Do we have equivalent function for uoutportB and nInportB in FW where we can make a wrapper function for our application.
How do we force 10 characters for Identifiers in (x)harbour?
thanks,
Jose