In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Wrapper de Polygon()

Foro público de Xailer en español
Responder
xevi[1]
Mensajes: 39
Registrado: Lun Jun 14, 2010 3:52 pm

Wrapper de Polygon()

Mensaje 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.
xevi[1]
Mensajes: 39
Registrado: Lun Jun 14, 2010 3:52 pm

Wrapper de Polygon()

Mensaje 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.
Responder