Page 1 of 1

C into PRG problem-RESOLVED

PostPosted: Tue Aug 17, 2021 3:45 am
by richard-service
Hi

When I maintain my old application.
xHarbour v1.2.3 / FWH1312

I have C code in PRG below:

Code: Select all  Expand view

#pragma BEGINDUMP

   #include "windows.h"

   int  WINAPI PEA_SamExeNhiQuery(LPSTR cHostname, int nPort, LPSTR cBuscode, int nCom, LPSTR cDocid, LPSTR cPatdid, LPSTR cPatbirth);
   void WINAPI PEA_GetMsg(LPSTR cBuffer,int * nLen );

   HB_FUNC( PEA_SAMEXENHIQUERY )
   {
     LPSTR  cHostname = hb_parc(1) ;
     int    nPort     = hb_parni(2);
     LPSTR  cBuscode  = hb_parc(3) ;
     int    nCom      = hb_parni(4);
     LPSTR  cDocid    = hb_parc(5) ;
     LPSTR  cPatdid   = hb_parc(6) ;
     LPSTR  cPatbirth = hb_parc(7) ;
     int    nErrCode ;

     nErrCode = PEA_SamExeNhiQuery(cHostname,nPort,cBuscode,nCom,cDocid,cPatdid,cPatbirth ) ;

     hb_retni( nErrCode );
   }

   HB_FUNC( PEA_GETMSG )
   {
     LPSTR  cBuffer = hb_parc(1);
     long   nLen    = hb_parni(2);
     PEA_GetMsg( cBuffer, &nLen );
   }

#pragma ENDDUMP
 


When I compile it. appear error message below:

hb_retni( nErrCode ); Undefined symbol 'hb_stackST'

Any suggestion?

Re: C into PRG problem

PostPosted: Tue Aug 17, 2021 6:27 am
by hmpaquito

Re: C into PRG problem

PostPosted: Tue Aug 17, 2021 3:30 pm
by carlos vargas
Code: Select all  Expand view

#pragma BEGINDUMP

   #include "windows.h"
   #include "hbapi.h"
   ...
 

Re: C into PRG problem

PostPosted: Thu Aug 19, 2021 7:22 am
by richard-service
carlos vargas wrote:
Code: Select all  Expand view

#pragma BEGINDUMP

   #include "windows.h"
   #include "hbapi.h"
   ...
 


I will try it again. Thank you so much.

Re: C into PRG problem

PostPosted: Thu Aug 19, 2021 7:22 am
by richard-service
hmpaquito wrote:https://comp.lang.xharbour.narkive.com/ixJp2vGG/compilation-problemm


Thanks for your good information.

Re: C into PRG problem

PostPosted: Thu Aug 19, 2021 10:43 am
by Antonio Linares
A better way is:

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

Means to look for them in the include paths

Re: C into PRG problem

PostPosted: Tue Aug 24, 2021 9:36 am
by richard-service
Antonio Linares wrote:A better way is:

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

Means to look for them in the include paths


Antonio,

Solved! Thank you.