xHarbour builder y FWH - solución

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

xHarbour builder y FWH - solución

Post 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 
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply