xBrowse not showing at all with MinGw and Harbour

Post Reply
User avatar
concentra
Posts: 107
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

xBrowse not showing at all with MinGw and Harbour

Post by concentra »

I am triing to program a browse using xBrowse without success.
The window shows up empty with no messages at all.
I was unable to figure out what am I doing wrong...
I am using FiveWin with MinGw and Harbour.
I made a small self contained sample of what I am coding.
Could someone inspect the code above and point what's wrong ?

Code: Select all

Function Main()

   #include "fivewin.ch"
   #include "xbrowse.ch"

   DBCREATE( "BTESTE.DBF", { { "CODIGO"    , "C", 08, 00 },;
                             { "DESCRICAO" , "C", 40, 00 } } )

   USE BTESTE.DBF EXCLUSIVE ALIAS BTESTE

   FOR I:=1 TO 200
     BTESTE->( DBAPPEND() )
     BTESTE->CODIGO     := STRZERO(I,8)
     BTESTE->DESCRICAO  := REPLICATE("X",MOD(I,39)+1)
   NEXT

   BTESTE -> ( DBGOTOP() )

   oDLG := TWINDOW():NEW( 0, 0, 50, 100 ,"xBrowse Test" )

   @ 0,0 XBROWSE oBRW ALIAS "BTESTE" OF oDLG

   ADD COLUMN TO oBRW TITLE "CODIGO"    DATA BTESTE->CODIGO    SIZE  80
   ADD COLUMN TO oBRW TITLE "DESCRICAO" DATA BTESTE->DESCRICAO SIZE 320

   ACTIVATE WINDOW oDLG

   CLOSE DATABASES

RETURN
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xBrowse not showing at all with MinGw and Harbour

Post by anserkk »

You missed the code :)

Code: Select all

oBrw:CreateFromCode()

Code: Select all

#include "fivewin.ch"
#include "xbrowse.ch"
Function Main()
   DBCREATE( "BTESTE.DBF", { { "CODIGO"    , "C", 08, 00 },;
                             { "DESCRICAO" , "C", 40, 00 } } )

   USE BTESTE.DBF EXCLUSIVE ALIAS BTESTE

   FOR I:=1 TO 200
     BTESTE->( DBAPPEND() )
     BTESTE->CODIGO     := STRZERO(I,8)
     BTESTE->DESCRICAO  := REPLICATE("X",MOD(I,39)+1)
   NEXT

   BTESTE -> ( DBGOTOP() )

   oDLG := TWINDOW():NEW( 0, 0, 50, 100 ,"xBrowse Test" )

   @ 0,0 XBROWSE oBRW ALIAS "BTESTE" OF oDLG SIZE 0,0

   ADD COLUMN TO oBRW TITLE "CODIGO"    DATA BTESTE->CODIGO    SIZE  80
   ADD COLUMN TO oBRW TITLE "DESCRICAO" DATA BTESTE->DESCRICAO SIZE 320
   
   oBrw:CreateFromCode()

   ACTIVATE WINDOW oDLG

   CLOSE DATABASES

RETURN
Regards
Anser
User avatar
concentra
Posts: 107
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: xBrowse not showing at all with MinGw and Harbour

Post by concentra »

Very thanks Anser !
Thats it.
Post Reply