gtwvg + fivewin + multithread
Posted: Wed Aug 14, 2024 2:28 am
I use GTWVG + Multithread + DBF + ADO/MySQL for a long time.
On multithread, DBFs are open/closed on each thread, can use CLOSE DATABASES to close DBFs on thread.
I test samples/guicui.prg
it crashes, or close more than one window.
With multithread things are easy.
Same sample using multithread, all works ok.
#include "FiveWin.ch"
#include "hbgtinfo.ch"
#include "std.ch"
REQUEST HB_GT_WVT
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "Main FWH Window"
ACTIVATE WINDOW oWnd ;
ON INIT hb_ThreadStart( { || Child( oWnd ) } );
ON CLICK hb_ThreadStart( { || Child( oWnd ) } )
return nil
function Child( oWnd )
local cFirst := Space( 10 ), cLast := Space( 10 ), GetList := {}
hb_gtReload( "WVT" )
HB_GtInfo( HB_GTI_CODEPAGE, "ES850C" )
Hb_GtInfo( HB_GTI_FONTNAME, 'Lucida Console')
hb_gtInfo( HB_GTI_WINTITLE, "opciones CONSOLA en Windows" )
HB_GtInfo( HB_GTI_CLOSABLE, .T. )
SetMode( 25, 80 )
SET COLOR TO "W+/B"
CLS
@ 1, 2 SAY "First:" GET cFirst
@ 3, 3 SAY "Last:" GET cLast // VALID ( ReadExit(), .T. )
READ
return nil
I would like to do the same, but call fivewin dialog from wvg.
On multithread, DBFs are open/closed on each thread, can use CLOSE DATABASES to close DBFs on thread.
I test samples/guicui.prg
it crashes, or close more than one window.
With multithread things are easy.
Same sample using multithread, all works ok.
#include "FiveWin.ch"
#include "hbgtinfo.ch"
#include "std.ch"
REQUEST HB_GT_WVT
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "Main FWH Window"
ACTIVATE WINDOW oWnd ;
ON INIT hb_ThreadStart( { || Child( oWnd ) } );
ON CLICK hb_ThreadStart( { || Child( oWnd ) } )
return nil
function Child( oWnd )
local cFirst := Space( 10 ), cLast := Space( 10 ), GetList := {}
hb_gtReload( "WVT" )
HB_GtInfo( HB_GTI_CODEPAGE, "ES850C" )
Hb_GtInfo( HB_GTI_FONTNAME, 'Lucida Console')
hb_gtInfo( HB_GTI_WINTITLE, "opciones CONSOLA en Windows" )
HB_GtInfo( HB_GTI_CLOSABLE, .T. )
SetMode( 25, 80 )
SET COLOR TO "W+/B"
CLS
@ 1, 2 SAY "First:" GET cFirst
@ 3, 3 SAY "Last:" GET cLast // VALID ( ReadExit(), .T. )
READ
return nil
I would like to do the same, but call fivewin dialog from wvg.