threads no harbour
Enviado: 02 Ago 2008 14:46
Boa tade caros colegas
Como eu uso threads com o harbour?
Grato
Como eu uso threads com o harbour?
Grato
Código: Selecionar todos
ference to `hb_mouse_Col'
C:\xHgtk\xharbour\lib/librtl.a(mouseapi.o):mouseapi.c:(.text+0x65): undefined re
ference to `hb_mouse_Row'
C:\xHgtk\xharbour\lib/librtl.a(mouseapi.o):mouseapi.c:(.text+0x75): undefined re
ference to `hb_mouse_SetPos'
C:\xHgtk\xharbour\lib/librtl.a(mouseapi.o):mouseapi.c:(.text+0x85): undefined re
ference to `hb_mouse_IsButtonPressed'
C:\xHgtk\xharbour\lib/librtl.a(mouseapi.o):mouseapi.c:(.text+0x95): undefined re
ference to `hb_mouse_CountButton'
C:\xHgtk\xharbour\lib/librtl.a(mouseapi.o):mouseapi.c:(.text+0xa5): undefined re
ference to `hb_mouse_SetBounds'
C:\xHgtk\xharbour\lib/librtl.a(mouseapi.o):mouseapi.c:(.text+0xb5): undefined re
ference to `hb_mouse_GetBounds'
C:\xHgtk\xharbour\lib/librtl.a(gt.o):gt.c:(.text+0x56): undefined reference to `
hb_gt_Version'
C:\xHgtk\xharbour\lib/librtl.a(maxrow.o):maxrow.c:(.text+0x50): undefined refere
nce to `hb_gt_info'
C:\xHgtk\xharbour\lib/librtl.a(maxrow.o):maxrow.c:(.text+0x7a): undefined refere
nce to `hb_gt_info'
C:\xHgtk\xharbour\lib/librtl.a(maxrow.o):maxrow.c:(.text+0xd0): undefined refere
nce to `hb_gt_info'
C:\xHgtk\xharbour\lib/librtl.a(maxrow.o):maxrow.c:(.text+0xfa): undefined refere
nce to `hb_gt_info'
collect2: ld returned 1 exit status
C:\xHgtk\samples\functions>build trayiconCódigo: Selecionar todos
#include "hbclass.ch"
#include "xhgtk.ch"
PROCEDURE Main()
Local oWindow
Local oButton1
Local oButton2
INIT WINDOW oWindow ;
AT 0,0 ;
TITLE "Button Command Test" ;
SIZE 640, 480 ;
CENTER ;
RESIZEABLE
@ 435, 460 BUTTON oButton1 ;
CAPTION "_Ok" ;
SIZE 80, 30 ;
ACTION Test() ;
HINT "Ok Hint" ;
IMAGE "gtk-ok" ;
OF oWindow
@ 400, 550 BUTTON oButton2 ;
CAPTION "_Close" ;
SIZE 80, 80 ;
ACTION oWindow:close() ;
HINT "Close Hint" ;
IMAGE "gtk-close" POSITION GTK_POS_TOP;
OF oWindow
ACTIVATE WINDOW oWindow
RETURN
PROCEDURE Test()
LOCAL nStart := Seconds()
LOCAL oMyObject := MyClass()
LOCAL MethodPtr := HB_ObjMsgPtr( oMyObject, "Count" )
LOCAL xThread
CLEAR SCREEN
nStart := Seconds()
// 1st param is the Startup Function, 2nd. is Self if 1st param is a Method or NIL otherwise,
// rest are paramaters to be passed to the Function/Method.
StartThread ( @MyThreadFunc(), 2, "1st Thread:", 0, 5000 )
StartThread ( @MyThreadFunc(), 4, "2nd Thread:", 5000, 10000 )
StartThread ( @MyThreadFunc(), 6, "3rd Thread:", 10000, 15000 )
WaitForThreads()
@ 8, 0 SAY "Threads Time:" + Str( Seconds() - nStart )
nStart := Seconds()
// StartThread() for methods can be called using an already available
// Method Pointer or using a method name
StartThread ( oMyObject, "Count", 10, "1st Thread:", 0, 5000 )
StartThread ( oMyObject, "Count", 12, "2nd Thread:", 5000, 10000 )
StartThread ( oMyObject, MethodPtr, 14, "3rd Thread:", 10000, 15000 )
WaitForThreads()
@ 16, 0 SAY "[METHODS] Threads Time:" + Str( Seconds() - nStart )
nStart := Seconds()
MyThreadFunc( 18, "1st Run:", 0, 5000 )
MyThreadFunc( 20, "2nd Run:", 5000, 10000 )
MyThreadFunc( 22, "3rd Run:", 10000, 15000 )
@ 24, 0 SAY "Sequential Time:" + Str( Seconds() - nStart )
Inkey(0)
RETURN
PROCEDURE MyThreadFunc( nRow, cName, nStart, nMax )
LOCAL i
FOR i := nStart TO nMax
//@ nRow, 10 SAY cName + Str( i )
// Atomic operation
DispOutAt(nRow, 10, cName + Str( i ))
NEXT
RETURN
CLASS MyClass
METHOD Count( nRow, cName, nStart, nMax )
ENDCLASS
METHOD Count( nRow, cName, nStart, nMax ) CLASS MyClass
LOCAL i
FOR i := nStart TO nMax
//@ nRow, 10 SAY cName + Str( i )
// Atomic operation
DispOutAt(nRow, 10, cName + Str( i ))
NEXT
RETURN NIL
Abra o tópico e me avise que colocarei um passo a passo inicial.sygecom escreveu:Olá Mhackervix,
Seria possivel você colocar um passo a passo para ajudar inciantes que querem testar a xbase++ , estou querendo testar, mas nem sei de onde baixar, e como dar os primeiros passos ou até mesmo se posso aproveitar algo dos meus sistema que esta usando lib de terceiros como a VL, se for possivel, abra um topico em:
viewforum.php?f=28
Desde já Agradeço.....