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.
- Code: Select all Expand view RUN
//----------------------------------------------------------------------------//// 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.htypedef 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