Antonio Linares wrote:Estimado Carlos,
Puedes copiar aqui el c贸digo completo de la funci贸n en C ?
Gracias Antonio,
Este es el c贸digo, adjunto todo el fichero.
//----------------------------------------------------------------------------//
// 聽AUTOR.....: Manuel Exp垄sito Su聽rez 聽 聽Soft 4U '1994-2000 聽 聽 聽 聽 聽 聽 聽 聽 聽//
// 聽e-Mail....: expo2001@wanadoo.es 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //
// 聽CLASE.....: HBFORCE.C 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //
// 聽FECHA MOD.: 10/11/2000 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽//
// 聽VERSION...: 9.00 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽//
// 聽PROPOSITO.: Accesos a bajo nivel a la estructura WorkArea de Harbour 聽 聽 聽//
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
//Para las RDD nativas de Harbour
#include "hbrdddbf.h"
#include "hbapirdd.h"
//----------------------------------------------------------------------------//
HB_FUNC( DBFHDL )
{
聽 聽LPDBFAREA pArea = hb_rddGetCurrentWorkAreaPointer();
聽 聽if( pArea )
聽 聽// Con la nueva versi贸n de Harbour (9.02), y el cambio del 'valor' hDataFile
聽 聽// por pDataFile en la estructura _DBFAREA de HbRddDbf.h, esta funci贸n no es
聽 聽// correcta y debe cambiarse por hb_retptr().
聽 聽//
聽 聽// hb_retni( pArea->hDataFile );
聽 聽//else
聽 聽// 聽 hb_retni( 0 );
聽 聽 聽 hb_retptr( pArea->pDataFile );
聽 聽else
聽 聽 聽 hb_retptr( 0 );
}
//----------------------------------------------------------------------------//
HB_FUNC( ISSHARED )
{
聽 聽LPDBFAREA pArea = hb_rddGetCurrentWorkAreaPointer();
聽 聽if( pArea )
聽 聽 聽 hb_retl( pArea->fShared );
聽 聽else
聽 聽 聽 hb_retl( HB_FALSE );
}
//----------------------------------------------------------------------------//
HB_FUNC( ISREADONLY )
{
聽 聽LPDBFAREA pArea = hb_rddGetCurrentWorkAreaPointer();
聽 聽if( pArea )
聽 聽 聽 hb_retl( pArea->fReadonly );
聽 聽else
聽 聽 聽 hb_retl( HB_FALSE );
}
//----------------------------------------------------------------------------//
// Para la RDD ADS de Harbour
// Extraido de rddads.h
typedef unsigned long 聽ADSHANDLE;
typedef struct _ADSAREA_
{
聽 聽struct _RDDFUNCS * lprfsHost; /* Virtual method table for this workarea */
聽 聽HB_USHORT uiArea; 聽 聽 聽 聽 聽 聽 聽 聽/* The number assigned to this workarea */
聽 聽void * atomAlias; 聽 聽 聽 聽 聽 聽 /* Pointer to the alias symbol for this workarea */
聽 聽HB_USHORT uiFieldExtent; 聽 聽 聽 聽 /* Total number of fields allocated */
聽 聽HB_USHORT uiFieldCount; 聽 聽 聽 聽 聽/* Total number of fields used */
聽 聽LPFIELD lpFields; 聽 聽 聽 聽 聽 聽 /* Pointer to an array of fields */
聽 聽void * lpFieldExtents; 聽 聽 聽 聽/* Void ptr for additional field properties */
聽 聽PHB_ITEM valResult; 聽 聽 聽 聽 聽 /* All purpose result holder */
聽 聽HB_BOOL fTop; 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽/* TRUE if "top" */
聽 聽HB_BOOL fBottom; 聽 聽 聽 聽 聽 聽 聽 聽 /* TRUE if "bottom" */
聽 聽HB_BOOL fBof; 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽/* TRUE if "bof" */
聽 聽HB_BOOL fEof; 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽/* TRUE if "eof" */
聽 聽HB_BOOL fFound; 聽 聽 聽 聽 聽 聽 聽 聽 聽/* TRUE if "found" */
聽 聽DBSCOPEINFO dbsi; 聽 聽 聽 聽 聽 聽 /* Info regarding last LOCATE */
聽 聽DBFILTERINFO dbfi; 聽 聽 聽 聽 聽 聽/* Filter in effect */
聽 聽LPDBORDERCONDINFO lpdbOrdCondInfo;
聽 聽LPDBRELINFO lpdbRelations; 聽 聽/* Parent/Child relationships used */
聽 聽HB_USHORT uiParents; 聽 聽 聽 聽 聽 聽 /* Number of parents for this area */
聽 聽HB_USHORT heap;
聽 聽HB_USHORT heapSize;
聽 聽HB_USHORT rddID;
聽 聽/*
聽 聽* 聽ADS's additions to the workarea structure
聽 聽*
聽 聽* 聽Warning: The above section MUST match WORKAREA exactly! 聽Any
聽 聽* 聽additions to the structure MUST be added below, as in this
聽 聽* 聽example.
聽 聽*/
聽 聽char * szDataFileName; 聽 聽 聽 聽/* Name of data file */
聽 聽HB_USHORT uiHeaderLen; 聽 聽 聽 聽 聽 /* Size of header */
聽 聽HB_USHORT uiRecordLen; 聽 聽 聽 聽 聽 /* Size of record */
聽 聽HB_ULONG ulRecCount; 聽 聽 聽 聽 聽 聽 /* Total records */
聽 聽HB_ULONG ulRecNo; 聽 聽 聽 聽 聽 聽 聽 聽/* Current record */
聽 聽HB_BYTE bYear; 聽 聽 聽 聽 聽 聽 聽 聽 聽 /* Last update */
聽 聽HB_BYTE bMonth;
聽 聽HB_BYTE bDay;
聽 聽HB_USHORT * pFieldOffset; 聽 聽 聽 聽/* Pointer to field offset array */
聽 聽HB_BYTE * pRecord; 聽 聽 聽 聽 聽 聽 聽 /* Buffer of record data */
聽 聽HB_ULONG maxFieldLen;
聽 聽HB_BOOL fValidBuffer; 聽 聽 聽 聽 聽 聽/* State of buffer */
聽 聽HB_BOOL fRecordChanged; 聽 聽 聽 聽 聽/* Record changed */
聽 聽HB_BOOL fShared; 聽 聽 聽 聽 聽 聽 聽 聽 /* Shared file */
聽 聽HB_BOOL fReadonly; 聽 聽 聽 聽 聽 聽 聽 /* Read only file */
聽 聽HB_BOOL fFLocked; 聽 聽 聽 聽 聽 聽 聽 聽/* TRUE if file is locked */
聽 聽ADSHANDLE hTable;
聽 聽ADSHANDLE hOrdCurrent;
聽 聽ADSHANDLE hStatement;
} ADSAREA;
typedef ADSAREA * ADSAREAP;
//----------------------------------------------------------------------------//
HB_FUNC( ADSDBFHDL )
{
聽 聽ADSAREAP pArea = hb_rddGetCurrentWorkAreaPointer();
聽 聽if( pArea )
聽 聽 聽 hb_retni( pArea->hTable );
聽 聽else
聽 聽 聽 hb_retni( 0 );
}
//----------------------------------------------------------------------------//
HB_FUNC( ADSISSHARED )
{
聽 聽ADSAREAP pArea = hb_rddGetCurrentWorkAreaPointer();
聽 聽if( pArea )
聽 聽 聽 hb_retl( pArea->fShared );
聽 聽else
聽 聽 聽 hb_retl( HB_FALSE );
}
//----------------------------------------------------------------------------//
HB_FUNC( ADSISREADONLY )
{
聽 聽ADSAREAP pArea = hb_rddGetCurrentWorkAreaPointer();
聽 聽if( pArea )
聽 聽 聽 hb_retl( pArea->fReadonly );
聽 聽else
聽 聽 聽 hb_retl( HB_FALSE );
}
//----------------------------------------------------------------------------//
Los errores que obtiene Leonardo al compilar son:
C:\FWH17\fwh\TDBF_CG>xhb_make
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
c:\bcc55\BIN\bcc32 -tWM -DHB_API_MACROS -DHB_STACK_MACROS -DHB_OS_WIN_32 -DHB_FM_STATISTICS_OFF -d -a8 -OS -O2 -5 -c -w-8075 -I.\include;c:\fwh17\xhar123\include /nobj source\HbForce.c
Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
source\HBFORCE.C:
Error E2451 source\HBFORCE.C 31: Undefined symbol 'hb_stackST' in function HB_FUN_DBFHDL
Error E2451 source\HBFORCE.C 42: Undefined symbol 'hb_stackST' in function HB_FUN_ISSHARED
Error E2451 source\HBFORCE.C 53: Undefined symbol 'hb_stackST' in function HB_FUN_ISREADONLY
Error E2451 source\HBFORCE.C 125: Undefined symbol 'hb_stackST' in function HB_FUN_ADSDBFHDL
Error E2451 source\HBFORCE.C 136: Undefined symbol 'hb_stackST' in function HB_FUN_ADSISSHARED
Error E2451 source\HBFORCE.C 147: Undefined symbol 'hb_stackST' in function HB_FUN_ADSISREADONLY
*** 6 errors in Compile ***
** error 1 ** deleting obj\HbForce.obj
Hay errores en la construccion de TDbf