Page 1 of 1

xHarbour builder y FWH - solución

Posted: Thu Aug 03, 2006 5:57 pm
by Antonio Linares
Hay un problema con la versión más reciente de xHarbour builder y FWH. Copia este código a tu PRG principal, y se soluciona:

Code: Select all

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

typedef struct
{
   FARPROC farProc;
   BYTE bType;
   BYTE bReturn;
   BYTE bParams;
   BYTE bParam[ 15 ];
} STRFUNC;

HB_FUNC( GETPROCADDRESS )
{
   STRFUNC strFunc;
   BYTE b = 0;
   BYTE bFunc[ 4 ];

   strFunc.bParams = hb_pcount() - 4;
   
   if( ISNUM( 2 ) )
   {
      bFunc[ 0 ]      = hb_parni( 2 );
      bFunc[ 1 ]      = 0;
      strFunc.farProc = GetProcAddress( ( HMODULE ) hb_parnl( 1 ), ( LPSTR ) bFunc );
   }
   else
      strFunc.farProc = GetProcAddress( ( HMODULE ) hb_parnl( 1 ), hb_parc( 2 ) );

   strFunc.bType      = hb_parl( 3 );
   strFunc.bReturn    = hb_parni( 4 );

   while( b < strFunc.bParams )
   {
      strFunc.bParam[ b ] = hb_parni( 5 + b );
      b++;                // keep this here cause Borland 5
   }

   hb_retclen( ( char * ) &strFunc, sizeof( STRFUNC ) - 15 + strFunc.bParams );
}

#pragma ENDDUMP