Página 1 de 1

Wrapper de Polygon()

Publicado: Lun Dic 23, 2013 1:03 am
por xevi[1]
Alguien puede echarme una mano en este wrapper???
Segun MSDN
http://msdn.microsoft.com/en-us/library ... sktop/dd16 2814(v=vs.85).aspx
BOOL Polygon(
_In_ HDC hdc,
_In_ const POINT *lpPoints,
_In_ int nCount
);
Lo intento en Xailer...
#pragma BEGINDUMP
#include <windows.h>
#include <xailer.h>
XA_FUNC( POLYGON )
{
int hdc = hb_parnl( 1 );
int lpPoints = hb_parnl( 2 );
int nCount = hb_parnl( 3 );
hb_retl( Polygon( hdc, lpPoints , nCount ) );
}
#pragma ENDDUMP
Pero como no entiendo NADA de C... pues que no levanto cabeza!!!
Compilant Form1.prg...
Form1.prg:55:4: warning: passing argument 1 of 'Polygon' makes pointer from
integer without a cast [enabled by default]
c:xailerhb32compmingwincludewingdi.h:2946:23: note: expected 'HDC' but
argument is of type 'int'
Form1.prg:55:4: warning: passing argument 2 of 'Polygon' makes pointer from
integer without a cast [enabled by default]
c:xailerhb32compmingwincludewingdi.h:2946:23: note: expected 'const
struct POINT *' but argument is of type 'int'
Enllaçant prova.exe...
1 Files, 4 Warnings, 0 Errors
Temps de compilació: 0.58s Temps d'enllaçat: 0.98s Temp total: 1.58s
Gracias.
Un Saludo,
Xevi.

Wrapper de Polygon()

Publicado: Lun Dic 23, 2013 1:22 am
por xevi[1]
Sigo... sin entender, pero en mi intención está!!!
#pragma BEGINDUMP
#include <windows.h>
#include <xailer.h>
XA_FUNC( POLYGON )
{
const POINT *lpPoints = hb_parc( 2 );
hb_retl( Polygon( (HDC) hb_parnl( 1 ), lpPoints , hb_parnl( 3 ) ) );
}
#pragma ENDDUMP
Ahora SOLO me arroja un error de creación de la constante POINT...
Compilant Form1.prg...
Form1.prg:57:28: warning: initialization from incompatible pointer type
[enabled by default]
Enllaçant prova.exe...
1 Files, 1 Warnings, 0 Errors
Temps de compilació: 0.58s Temps d'enllaçat: 0.94s Temp total: 1.55s
Como inicializo esta variable ???
Gracias.
Un Saludo,
Xevi.