compile error

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

compile error

Post by Silvio »

i MADE SOME TEST :

I WANT CONVERTE FWBROW.PRG INTO FWPPC


MAIN.PRG

Code: Select all

#include "FWCE.ch"


REQUEST DBFCDX

//----------------------------------------------------------------------------//


FUNCTION Main()

    LOCAL oBmp

    Config()

    DEFINE BITMAP oBmp NAME '\Five.BMP'

    DEFINE WINDOW oWnd TITLE "RivaManiaPro"
    ACTIVATE WINDOW oWnd ;
             ON PAINT oWnd:SayBitmap( 60, 10, oBmp ) ;
             ON INIT Control()

    DbCloseAll()

    oBmp:End()

RETU NIL


STATIC FUNCTION Config()


  RddRegister( "DBFCDX", 1 )
  RddSetDefault( "DBFCDX" )

    SET DELETED ON
    SET DATE TO ITALIAN
    SET SOFTSEEK ON
    SET CENTURY ON
    SET EPOCH TO 2000

RETU NIL


STATIC FUNCTION Control()
   LOCAL oDummy

     @ 0, 0 BTNBMP NAME "EXIT" SIZE 30, 30 OF oWnd ;
           ACTION IF( MsgYesNo( 'Desideri uscire ?', 'Sistema' ), oWnd:End(), )

     @ 0, 30 BTNBMP NAME "client" SIZE 30, 30 OF oWnd  ACTION CLIENTS()

   
    @ 0, 210 BTNBMP NAME "info" SIZE 30, 30 OF oWnd ;
             ACTION About()

    @ 0, 0 BTNBMP oDummy NAME "" SIZE 240, 30 OF oWnd
                  oDummy:Disable()

RETU NIL



STATIC FUNCTION Client()

   local oDlg
   local oLbx
   local cVar



   local aHBitMaps:= { ReadBitmap( 0, CurDir() +"\Level1.bmp" ), ; // BitMaps de 14 x 32
                       ReadBitmap( 0, CurDir() +"\Level2.bmp" ), ;
                       ReadBitmap( 0, CurDir() +"\Level3.bmp" ), ;
                       ReadBitmap( 0, CurDir() +"\Level4.bmp" ),;
                       ReadBitmap( 0, CurDir() +"\Level5.bmp" ) }
   local n

  if ! File( CurDir() +"clientes.dbf" )
      DbCreate( CurDir() +"Clientes.dbf", { { "Nombre",    "C", 40, 0 },;
                                  { "Direccion", "C", 50, 0 },;
                                  { "Telefono",  "C", 12, 0 },;
                                  { "Edad",      "N",  2, 0 },;
                                  { "Productos", "C", 10, 0 },;
                                  { "Nivel",     "N",  2, 0 } } )
   endif




    USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"


   if RecCount() == 0
      APPEND BLANK
   endif

    if ! File( CurDir() + "\CliName.CDX" )
      INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
   endif

   Clientes->( OrdSetFocus( "CliName" ) )
   Clientes->( DbGoTop() )


   DEFINE DIALOG oDlg  TITLE "Clients Management"


            @ 0, 0  LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
                                        Clientes->Nombre, AllTrim( Clientes->Direccion ),;
                                        Clientes->Telefono,;
                                        Str( Clientes->Edad, 3 ) ;
                                 HEADERS    "L", "Name", "Address", "Phone", "Age" ;
                                 FIELDSIZES 16, 222, 213, 58, 24 ;
                                 SIZE 240, 250 OF oDlg


       // Lets use different row colors
  oLbx:nClrText      = { || SelColor( Clientes->Nivel ) }
  oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }


   @ 14,  0 BUTTON "&New" SIZE 40, 20
   *ACTION EditClient( oLbx, .t. )
   @ 14,  7 BUTTON "&Mod" SIZE 40, 20
   @ 14, 14 BUTTON "&Del" SIZE 40, 20
   @ 14, 21 BUTTON "&Sea"  SIZE 40, 20
   @ 14, 28 BUTTON "&Pri"  SIZE 40, 20
   @ 14, 35 BUTTON "&Exi"  SIZE 40, 20



   ACTIVATE DIALOG oDlg ;
   ON INIT DlgFullScreen( oDlg:hWnd )



    USE

  AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )

RETU NIL

 *----------------------
STATIC FUNCTION About()
*----------------------
    LOCAL oBmp, oDlg, oSay, oFont
    LOCAL cText := 'RivaMania Pro 1.0' + CRLF + CRLF + ;
                   'By Falconi Silvio'

    DEFINE FONT oFont NAME 'Arial' SIZE 0, -10

   DEFINE DIALOG oDlg Title "Autori"

   @ 1,2  BITMAP oBmp NAME 'Five' SIZE 80,80 OF oDlg NOBORDER ADJUST

       @ 6.5,6  SAY  oSay PROMPT cText SIZE 60,40 OF oDlg ;
                 FONT oFont COLOR CLR_BLACK, CLR_WHITE

        oDlg:blClicked := {|| oDlg:End() }
        oBmp:blClicked := {|| oDlg:End() }


ACTIVATE DIALOG oDlg ;
ON INIT DlgFullScreen( oDlg:hWnd )

    oBmp:End()
    oFont:End()

    RETU NIL



static function SelColor( nNivel )

   local nColor := CLR_BLACK

   do case
      case nNivel == 1
           nColor = CLR_HRED

      case nNivel == 2
           nColor = CLR_HGREEN

      case nNivel == 3
           nColor = CLR_HBLUE
   endcase

return nColor


//----------------------------------------------------------------------------//

function DialogButtons()

local oMenu

DEFINE MENU oMenu RESOURCE 102 ;
BITMAPS 10 ; // bitmap resources ID
IMAGES 2 // number of images in the bitmap

REDEFINE MENUITEM ID 110 OF oMenu ACTION MsgInfo( "OK" )

REDEFINE MENUITEM ID 120 OF oMenu ACTION MsgInfo( "Cancel" )

return oMenu

//----------------------------------------------------------------------------//


#pragma BEGINDUMP

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

HB_FUNC( DLGFULLSCREEN )
{
SHINITDLGINFO shidi;

memset( &shidi, 0, sizeof( SHINITDLGINFO ) );

shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = ( HWND ) hb_parnl( 1 );
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;

SHInitDialog( &shidi );
}

#pragma ENDDUMP



 
RESOURCE FILE

Code: Select all

#ifdef _CE
   #include "c:\work\vce\include\arm\windows.h"
   #include "c:\work\vce\include\arm\commctrl.h"
#endif

#define I_IMAGENONE      (-2)
#define IDS_HELP      104

#ifdef _CE
102 RCDATA
BEGIN
   102, 3,
   0, 110, TBSTATE_ENABLED, TBSTYLE_BUTTON, 201, 0, 0,
   0, 105, TBSTATE_ENABLED, TBSTYLE_SEP, -1, 0, 0,
   1, 120, TBSTATE_ENABLED, TBSTYLE_BUTTON, 202, 0, 0
END
#endif

STRINGTABLE DISCARDABLE
BEGIN
   201 "OK"
   202 "Cancel"
END

102 MENU DISCARDABLE
BEGIN
    MENUITEM "", 110
    MENUITEM "", 120
END

10 BITMAP "okcancel.bmp"
Info BITMAP "info.bmp"
Client BITMAP "client.bmp"
Exit BITMAP "exit.bmp"
Print BITMAP "print.bmp"
Busca BITMAP "busca.bmp"
Save BITMAP "savedisk.bmp"
New BITMAP "new.bmp"
Brosa BITMAP "brosa.bmp"
Five BITMAP "five.bmp"
FWPPC BITMAP "Fwppc.bmp"
omb BITMAP "omb.bmp"
 
WHY THIS MAKE ERROR ON COMPILING ?
MAKE ERROR WHEN i INSERT CLIENTS() FUNCTION
Best Regards, Saludos

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

Re: compile error

Post by Antonio Linares »

Silvio,

Please describe what error you get.

Also remember that not all FWH commands clauses are fully supported in FWPPC.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: compile error

Post by Silvio »

Antonio,
Sorry....
Now it is compiled ( I reset my computer)

but when run the exe it make error
Image

on line 92 there is :

USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"
Best Regards, Saludos

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

Re: compile error

Post by Antonio Linares »

Silvio,

Have you copied clientes.dbf and .cdx to your PC - emulator shared folder ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: compile error

Post by Silvio »

ok now it is ok

but there's a problem

when I show the listbox not show nitmaps on nlevel field
and it not show color of the listbox


local aHBitMaps:=Array( 5 )
aHBitMaps:= { ReadBitmap( 0, CurDir() +"\Level1.bmp" ), ; // BitMaps de 14 x 32
ReadBitmap( 0, CurDir() +"\Level2.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level3.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level4.bmp" ),;
ReadBitmap( 0, CurDir() +"\Level5.bmp" ) }

USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"


if RecCount() == 0
APPEND BLANK
endif

if ! File( CurDir() + "\CliName.CDX" )
INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
endif

Clientes->( OrdSetFocus( "CliName" ) )
Clientes->( DbGoTop() )


DEFINE DIALOG oDlgClient TITLE "Gestione clienti"

@ 0, 1 SAY " &Clients List" OF oDlgClient SIZE 60,10

@ 1, 0 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
Clientes->Nombre, AllTrim( Clientes->Direccion ),;
Clientes->Telefono,;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Name", "Address", "Phone", "Age" ;
FIELDSIZES 16, 95, 100, 14, 8 ;
SIZE 119, 120 OF oDlgClient


// Lets use different row colors
oLbx:nClrText = { || SelColor( Clientes->Nivel ) }
oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }

...

static function SelColor( nNivel )

local nColor := CLR_BLACK

do case
case nNivel == 1
nColor = CLR_HRED

case nNivel == 2
nColor = CLR_HGREEN

case nNivel == 3
nColor = CLR_HBLUE
endcase

return nColor
Best Regards, Saludos

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

Re: compile error

Post by Antonio Linares »

Silvio,

Have you copied the bitmaps to your PC - emulator shared folder ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: compile error

Post by Silvio »

yes
Best Regards, Saludos

Falconi Silvio
Post Reply