oPrn:RoundBox (solucionado)

oPrn:RoundBox (solucionado)

Postby juan_arroyo_t » Mon Jun 26, 2017 5:44 pm

Por favor alquien que me ayude

Quiero poner una caja redondeada y me da el siguiente alert

Error code: 0 loading GDI:EXE

Este es mi codigo ( el codigo lo tome del foro)

Code: Select all  Expand view

FUNCTION CajaRed()
   LOCAL oPrn
   LOCAL oPen

   DEFINE BRUSH oBrush   COLOR CLR_BLACK
   DEFINE BRUSH oFondo   COLOR CLR_HGRAY
   DEFINE PEN oPen WIDTH 2


   PRINT oPrn FROM USER PREVIEW TITLE "Ejemplo de caja redondeada"

      PAGE

         CajaRound( 1.6 , 15.0 , 3.4, 20.0, oPrn, 90, 90, oPen, oBrush ) //*nRGB(250,213,174*/) )

      ENDPAGE

      oPen:END()
      oPen:release()

   ENDPRINT

RETURN nil


Function CajaRound(nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush)
   LOCAL hOldPen, xCor := {} , yCor := {}
   local hOldBrush
   // Pasamos coordenadas de cms a pixel
   xCor := oPrn:Cmtr2Pix(nArriba,nIzq)
   yCor := oPrn:Cmtr2Pix(nAbajo,nDerecha)
   // Guardamos el Lapiz y la brocha que teniamos
   hOldPen   := SelectObject( oPrn:hDcOut, oPen:hPen )
   hOldBrush := SelectObject( oPrn:hDcOut, oBrush:hBrush )
   //Dibujamos el rectangulo redondeado
   roundrect(oPrn:hdcOut,xCor[2],xCor[1],yCor[2],yCor[1],a,b)
   // y  seleccionamos el que habiamos guardado
   selectObject( oPrn:hDcOut, hOldPen )
   selectObject( oPrn:hDcOut, hOldBrush )

RETURN NIL
 
Last edited by juan_arroyo_t on Tue Jun 27, 2017 6:06 pm, edited 1 time in total.
Juan Arroyo
México
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
User avatar
juan_arroyo_t
 
Posts: 196
Joined: Fri May 15, 2009 1:25 am
Location: Cuautitlán, Mexico

Re: oPrn:RoundBox

Postby karinha » Mon Jun 26, 2017 6:41 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPrn:RoundBox

Postby karinha » Mon Jun 26, 2017 6:43 pm

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION CajaRed()

   LOCAL oPrn
   LOCAL oPen
   LOCAL oBrush
   LOCAL oFondo

   DEFINE BRUSH oBrush   COLOR CLR_BLACK
   DEFINE BRUSH oFondo   COLOR CLR_HGRAY
   DEFINE PEN oPen WIDTH 2

   PRINT oPrn FROM USER PREVIEW TITLE "Ejemplo de caja redondeada"

      PAGE

         CajaRound( 1.6 , 15.0 , 3.4, 20.0, oPrn, 90, 90, oPen, oBrush ) //*nRGB(250,213,174*/) )

      ENDPAGE

   ENDPRINT

   oBrush:End()
   oFondo:End()
   oPen:End()
   oPen:release()

RETURN nil

Function CajaRound(nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush)

   LOCAL hOldPen, xCor := {} , yCor := {}
   local hOldBrush
   // Pasamos coordenadas de cms a pixel
   xCor := oPrn:Cmtr2Pix(nArriba,nIzq)
   yCor := oPrn:Cmtr2Pix(nAbajo,nDerecha)
   // Guardamos el Lapiz y la brocha que teniamos
   hOldPen   := SelectObject( oPrn:hDcOut, oPen:hPen )
   hOldBrush := SelectObject( oPrn:hDcOut, oBrush:hBrush )
   //Dibujamos el rectangulo redondeado
   roundrect(oPrn:hdcOut,xCor[2],xCor[1],yCor[2],yCor[1],a,b)
   // y  seleccionamos el que habiamos guardado
   selectObject( oPrn:hDcOut, hOldPen )
   selectObject( oPrn:hDcOut, hOldBrush )

RETURN NIL
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPrn:RoundBox

Postby karinha » Mon Jun 26, 2017 6:44 pm

Code: Select all  Expand view

echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\ws2_32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc
 


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPrn:RoundBox

Postby juan_arroyo_t » Mon Jun 26, 2017 9:24 pm

Karinha

Muchas gracias por responder

echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\ws2_32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc


Este es mi archivo de entorno
Code: Select all  Expand view

[Environment]
Description 1=Xharbour 1.2.1 y FWH 11.08
Description 2=
Description 3=
PRG Compiler ver=1.2.1
C compiler ver=5.82
Subsystem=
Last update=10/06/2011

[Advanced]
Command types=1,1,1,1,1,1,1,1,1

[Harbour]
HB_INSTALL=p:\32bits\11.08\xHarbour
HB_COMMAND=%HB_BIN_INSTALL%\Harbour.Exe %PRG% /m /n /es2 /i%HB_INC_INSTALL%
Option prefix=/

[C]
C_INSTALL=p:\32bits\Borland\bcc582
C_COMP_COMMAND=%C_BIN_INSTALL%\Bcc32.Exe -M -c -v -O2 -I%HB_INC_INSTALL% -I%C_INC_INSTALL%  -n%HOME%\Obj %C%
C_LIB_COMMAND=%C_BIN_INSTALL%\TLib.Exe %LIB% /P512 @%RSP% , %LST%
C_LINK_COMMAND=%C_BIN_INSTALL%\iLink32.Exe -Gn -aa -Tpe -s -v @%LNK%
C_RC_COMMAND=%C_BIN_INSTALL%\Brc32.Exe -r  -fo%RES%  %RC%
C_DLL_COMMAND=
Option prefix=-

[User]
POSTEXE_COMMAND=
POSTLIB_COMMAND=
POSTDLL_COMMAND=

[Files]
%C_LIB_INSTALL%\C0W32.OBJ=1
P:\32bits\11.08\FWH\lib\Fivehx.lib=2
P:\32bits\11.08\FWH\lib\Fivehc.lib=3
%HB_LIB_INSTALL%\rtl.lib=4
%HB_LIB_INSTALL%\vm.lib=5
%HB_LIB_INSTALL%\gtgui.lib=6
%HB_LIB_INSTALL%\lang.lib=7
%HB_LIB_INSTALL%\macro.lib=8
%HB_LIB_INSTALL%\rdd.lib=9
%HB_LIB_INSTALL%\dbfcdx.lib=10
%HB_LIB_INSTALL%\dbfntx.lib=11
%HB_LIB_INSTALL%\dbffpt.lib=12
%HB_LIB_INSTALL%\hbsix.lib=13
%HB_LIB_INSTALL%\common.lib=14
%HB_LIB_INSTALL%\pp.lib=15
%HB_LIB_INSTALL%\pcrepos.lib=16
%C_LIB_INSTALL%\cw32.lib=17
%C_LIB_INSTALL%\import32.lib=18
%C_LIB_INSTALL%\uuid.lib=19
%C_LIB_INSTALL%\PSDK\odbc32.lib=20
%C_LIB_INSTALL%\PSDK\rasapi32.lib=21
%C_LIB_INSTALL%\PSDK\iphlpapi.lib=22
%C_LIB_INSTALL%\PSDK\msimg32.lib=23
%C_LIB_INSTALL%\PSDK\nddeapi.lib=24
%HB_LIB_INSTALL%\ct.lib=25
%C_LIB_INSTALL%\PSDK\psapi.lib=26
%HB_LIB_INSTALL%\codepage.lib=27

[DLL Files]
%C_LIB_INSTALL%\C0W32.OBJ=1
%HB_LIB_INSTALL%\rtl.lib=2
%HB_LIB_INSTALL%\vm.lib=3
%HB_LIB_INSTALL%\gtgui.lib=4
%HB_LIB_INSTALL%\lang.lib=5
%HB_LIB_INSTALL%\macro.lib=6
%HB_LIB_INSTALL%\rdd.lib=7
%HB_LIB_INSTALL%\dbfntx.lib=8
%HB_LIB_INSTALL%\dbfcdx.lib=9
%HB_LIB_INSTALL%\dbfdbt.lib=10
%HB_LIB_INSTALL%\common.lib=11
%HB_LIB_INSTALL%\ct.lib=12
%HB_LIB_INSTALL%\pp.lib=13
%C_LIB_INSTALL%\CW32.LIB=14
%C_LIB_INSTALL%\IMPORT32.LIB=15
 


Me puedes orientar ?
Juan Arroyo
México
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
User avatar
juan_arroyo_t
 
Posts: 196
Joined: Fri May 15, 2009 1:25 am
Location: Cuautitlán, Mexico

Re: oPrn:RoundBox

Postby karinha » Mon Jun 26, 2017 9:26 pm

Te falta: gdiplus.lib

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPrn:RoundBox (solucionado)

Postby juan_arroyo_t » Tue Jun 27, 2017 6:05 pm

Karinha

Muchas gracias por tus atenciones

Agregué a mi archivo de entorno gdiplus.lib como me indicaste pero el mensaje de error seguía

Despues de mucho buscar encontré la solución tomando un fragmento de codigo de la TUtilPrn de The Full

Code: Select all  Expand view
#IFDEF __HARBOUR__
   DLL FUNCTION RoundRect( hDC AS LONG, ;
              iLeft AS _INT , iTop AS _INT, ;
              iRight AS _INT, iBottom AS _INT, ;
              iWidth AS _INT, iHeight AS _INT ) AS BOOL PASCAL LIB "GDI32.DLL"
#ELSE
   DLL FUNCTION RoundRect( hDC AS WORD, ;
              iLeft AS _INT , iTop AS _INT, ;
              iRight AS _INT, iBottom AS _INT, ;
              iWidth AS _INT, iHeight AS _INT ) AS BOOL PASCAL LIB "GDI.EXE"
#ENDIF


Finalmente el codigo quedó asi por si le puede ser util a alguien mas

Code: Select all  Expand view
#include "FiveWin.ch"

FUNCTION CajaRed()

   LOCAL oPrn
   LOCAL oPen
   LOCAL oBrush
   LOCAL oFondo

   DEFINE BRUSH oBrush   COLOR nRGB(250,213,174)   //CLR_BLACK
   DEFINE BRUSH oFondo   COLOR CLR_HGRAY
   DEFINE PEN oPen WIDTH 2

   PRINT oPrn FROM USER PREVIEW TITLE "Ejemplo de caja redondeada"

      PAGE

         CajaRound( 1.6 , 2.0 , 3.4, 20.0, oPrn, 90, 90, oPen, oBrush /*nRGB(250,213,174)*/ )

      ENDPAGE

   ENDPRINT

   oBrush:End()
   oFondo:End()
   oPen:End()
   oPen:release()

RETURN nil

Function CajaRound(nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush )

   LOCAL hOldPen, xCor := {} , yCor := {}
   local hOldBrush
   // Pasamos coordenadas de cms a pixel
   xCor := oPrn:Cmtr2Pix(nArriba,nIzq)
   yCor := oPrn:Cmtr2Pix(nAbajo,nDerecha)
   // Guardamos el Lapiz y la brocha que teniamos
   hOldPen   := SelectObject( oPrn:hDcOut, oPen:hPen )
   hOldBrush := SelectObject( oPrn:hDcOut, oBrush:hBrush )
   //Dibujamos el rectangulo redondeado
   roundrect(oPrn:hdcOut,xCor[2],xCor[1],yCor[2],yCor[1],a,b)
   // y  seleccionamos el que habiamos guardado
   selectObject( oPrn:hDcOut, hOldPen )
   selectObject( oPrn:hDcOut, hOldBrush )

RETURN NIL

#IFDEF __HARBOUR__
   DLL FUNCTION RoundRect( hDC AS LONG, ;
              iLeft AS _INT , iTop AS _INT, ;
              iRight AS _INT, iBottom AS _INT, ;
              iWidth AS _INT, iHeight AS _INT ) AS BOOL PASCAL LIB "GDI32.DLL"
#ELSE
   DLL FUNCTION RoundRect( hDC AS WORD, ;
              iLeft AS _INT , iTop AS _INT, ;
              iRight AS _INT, iBottom AS _INT, ;
              iWidth AS _INT, iHeight AS _INT ) AS BOOL PASCAL LIB "GDI.EXE"
#ENDIF


Saludos
Juan Arroyo
México
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
User avatar
juan_arroyo_t
 
Posts: 196
Joined: Fri May 15, 2009 1:25 am
Location: Cuautitlán, Mexico

Re: oPrn:RoundBox (solucionado)

Postby karinha » Tue Jun 27, 2017 8:35 pm

Mui bién... Más,

http://forums.fivetechsupport.com/viewtopic.php?f=6&t=34256

Yo uso FWHX17.01 y compila bién como puedes veer en la imagen.

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests