Hola
Estoy intentando hacer un programa multihilo y según tengo entendido tengo que enlazar la librería hbvmmt.lib en lugar de hbvm.lib
El programa está en Visual C.
También he visto que había que poner un define al compilar: /dHB_MT_VM
Recompilando el proyecto, la función hb_mtvm() me sigue devolviendo .F.
¿Alguien sabe que me falta?
Un saludo
Multithread
Re: Multithread
Me respondo
Aunque la función da .f., el programa funciona con funciones de threads.
Supongo que será normal. Si alguien sabe algo, se agradecería.
Un saludo
Aunque la función da .f., el programa funciona con funciones de threads.
Supongo que será normal. Si alguien sabe algo, se agradecería.
Un saludo
Paco García
Re: Multithread
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Re: Multithread
Ya me funcionó sin hacer nada. Como dicen los usuarios: Yo no he tocado nada. jejeje
Muchas gracias
Muchas gracias
Paco García
Re: Multithread
Hola a todos,
Trabajo con estas versiones:
FWH 64 13.05 (MSVC++)
Harbour 3.2.0dev (r1306211258)
No consigo hacer que me funcione este código de multihilos. No hace nada cuando se ejecuta hb_threadStart, devuelve nil.
¿Podríais echarme una mano por favor?
El código lo tomé de ejemplo en este post:
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=27120&start=0#p150719
El build que he usado es el básico de los samples. He probado añadiendo la %hdirl%\hbvmmt.lib según he leído en ese post, pero no he notado cambios.
Gracias de antemano!
Roberto Sánchez K.
Trabajo con estas versiones:
FWH 64 13.05 (MSVC++)
Harbour 3.2.0dev (r1306211258)
No consigo hacer que me funcione este código de multihilos. No hace nada cuando se ejecuta hb_threadStart, devuelve nil.
¿Podríais echarme una mano por favor?
Code: Select all | Expand
#include "fivewin.ch"PROCEDURE main() LOCAL aObj := Array(1000000) LOCAL oDlg, oButton PUBLIC nDestroyed := 0 DEFINE DIALOG oDlg SIZE 400, 500 @ 11, 0 BUTTON oButton PROMPT "Start" SIZE 80, 8 ACTION Button1_Click(oDlg) ACTIVATE DIALOG oDlg CENTERRETURNPROCEDURE Button1_Click(oDlg) LOCAL n := 0 LOCAL pMutex := HB_MutexCreate() LOCAL oThread LOCAL nVal FOR n :=1 to 10 hb_threadStart( @MyFuncForThreads(), pMutex, oDlg, n) NEXT n WaitForThreads() RETURNPROCEDURE MyFuncForThreads(pMutex, oDlg ,n) HB_MutexLock(pMutex) oDlg:Say(n,0,"Thread ID" + lTrim(Str(GetThreadID())) + " system id: " + lTrim(Str(GetSystemThreadID()))) HB_MutexUnlock(pMutex) RETURN
El código lo tomé de ejemplo en este post:
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=27120&start=0#p150719
El build que he usado es el básico de los samples. He probado añadiendo la %hdirl%\hbvmmt.lib según he leído en ese post, pero no he notado cambios.
Gracias de antemano!

Roberto Sánchez K.
Roberto Sánchez k:
Re: Multithread
Son dos librerias a añadir/sustituir
echo %hdirl%\hbvmmt.lib + >> b32.bc
and
echo %bcdir%\lib\cw32mt.lib + >> b32.bc
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Re: Multithread
Cristobal,
Muchas gracias por responder
* La 1ª lib hbvmmt la tenía ya puesta, pero no puedo quitar la de hbvm.lib del bat porque no compila. Incluyo entonces ambas y sí que compila ok
* La 2ª no la tengo disponible porque estoy compilando a 64 y el "linkador" es el vc64, que no tiene la cw32mt.lib
He supuesto que el sufijo "mt" de las lib tiene que ver con los multithread, con lo que he estado añadiendo las librerías de vc 64 que contenían "MT" en plan dando palos de ciego y agua de nuevo.
Os muestro mi bat con todas las librerías que incluyo.
Muchas gracias!
Muchas gracias por responder

* La 1ª lib hbvmmt la tenía ya puesta, pero no puedo quitar la de hbvm.lib del bat porque no compila. Incluyo entonces ambas y sí que compila ok
* La 2ª no la tengo disponible porque estoy compilando a 64 y el "linkador" es el vc64, que no tiene la cw32mt.lib
He supuesto que el sufijo "mt" de las lib tiene que ver con los multithread, con lo que he estado añadiendo las librerías de vc 64 que contenían "MT" en plan dando palos de ciego y agua de nuevo.
Os muestro mi bat con todas las librerías que incluyo.
Code: Select all | Expand
CLSECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ECHO ³ FWH 64 for Harbour 13.05 (MSVC++) May.2013 Harbour development power ³ÜECHO ³ (c) FiveTech, 1993-2013 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8 ³ÛECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßif ATHREAD == A GOTO :SINTAXif NOT EXIST THREAD.prg GOTO :NOEXISTif "%FWDIR%" == "" set FWDIR=D:\FWH64if "%HBDIR%" == "" set HBDIR=D:\harbour64ECHO Compiling...set hdir=%HBDIR%set hdirl=%hdir%\libset vcdir=D:\vc64set include=%vcdir%\include;%hdir%\include;%include%set lib=%vcdir%\lib;%hdir%\lib;%lib%%hdir%\bin\harbour THREAD /n /i%fwdir%\include;%hdir%\include /w /p /d__64__ IF ERRORLEVEL 1 GOTO COMPILEERROR@type comp.log@type warnings.log%vcdir%\bin\cl -TP -W3 -c THREAD.c:ENDCOMPILEIF EXIST THREAD.rc %vcdir%\bin\rc -r -I%hdir%\include;%vcdir%\include -D__64__ THREADecho THREAD.obj > msvc.tmpecho %fwdir%\lib\FiveH64.lib %fwdir%\lib\FiveHC64.lib >> msvc.tmpecho %hdirl%\hbrtl.lib >> msvc.tmpecho %hdirl%\hbvm.lib >> msvc.tmpecho %hdirl%\hbvmmt.lib >> b32.bcecho %hdirl%\gtgui.lib >> msvc.tmpecho %hdirl%\hblang.lib >> msvc.tmpecho %hdirl%\hbmacro.lib >> msvc.tmpecho %hdirl%\hbrdd.lib >> msvc.tmpecho %hdirl%\rddntx.lib >> msvc.tmpecho %hdirl%\rddcdx.lib >> msvc.tmpecho %hdirl%\rddfpt.lib >> msvc.tmpecho %hdirl%\hbsix.lib >> msvc.tmpecho %hdirl%\hbdebug.lib >> msvc.tmpecho %hdirl%\hbcommon.lib >> msvc.tmpecho %hdirl%\hbpp.lib >> msvc.tmpecho %hdirl%\hbcpage.lib >> msvc.tmpecho %hdirl%\hbwin.lib >> msvc.tmpecho %hdirl%\hbct.lib >> msvc.tmpecho %hdirl%\hbziparc.lib >> msvc.tmpecho %hdirl%\hbmzip.lib >> msvc.tmpecho %hdirl%\hbzlib.lib >> msvc.tmpecho %hdirl%\hbpcre.lib >> msvc.tmpecho %hdirl%\minizip.lib >> msvc.tmpecho %hdirl%\xhb.lib >> msvc.tmpecho %hdirl%\hbcplr.lib >> msvc.tmpecho %hdirl%\png.lib >> msvc.tmprem Uncomment these two lines to use Advantage RDDrem echo %hdirl%\rddads.lib >> msvc.tmprem echo %hdirl%\ace32.lib >> msvc.tmpecho %vcdir%\lib\kernel32.lib >> msvc.tmpecho %vcdir%\lib\user32.lib >> msvc.tmpecho %vcdir%\lib\gdi32.lib >> msvc.tmpecho %vcdir%\lib\winspool.lib >> msvc.tmpecho %vcdir%\lib\comctl32.lib >> msvc.tmpecho %vcdir%\lib\comdlg32.lib >> msvc.tmpecho %vcdir%\lib\advapi32.lib >> msvc.tmpecho %vcdir%\lib\shell32.lib >> msvc.tmpecho %vcdir%\lib\ole32.lib >> msvc.tmpecho %vcdir%\lib\oleaut32.lib >> msvc.tmpecho %vcdir%\lib\uuid.lib >> msvc.tmpecho %vcdir%\lib\odbc32.lib >> msvc.tmpecho %vcdir%\lib\odbccp32.lib >> msvc.tmpecho %vcdir%\lib\iphlpapi.lib >> msvc.tmpecho %vcdir%\lib\mpr.lib >> msvc.tmpecho %vcdir%\lib\version.lib >> msvc.tmpecho %vcdir%\lib\wsock32.lib >> msvc.tmpecho %vcdir%\lib\msimg32.lib >> msvc.tmpecho %vcdir%\lib\oledlg.lib >> msvc.tmpecho %vcdir%\lib\psapi.lib >> msvc.tmpecho %vcdir%\lib\gdiplus.lib >> msvc.tmpecho %vcdir%\lib\winmm.lib >> msvc.tmpecho %vcdir%\lib\clfsmgmt.lib >> msvc.tmpecho %vcdir%\lib\libcmt.lib >> msvc.tmpecho %vcdir%\lib\libcmtd.lib >> msvc.tmpecho %vcdir%\lib\libcpmt.lib >> msvc.tmpecho %vcdir%\lib\libcpmt1.lib >> msvc.tmpecho %vcdir%\lib\libcpmtd.lib >> msvc.tmpecho %vcdir%\lib\libcpmtd0.lib >> msvc.tmpecho %vcdir%\lib\libcpmtd1.lib >> msvc.tmpecho %vcdir%\lib\mgmtapi.lib >> msvc.tmp echo %vcdir%\lib\mtx.lib >> msvc.tmpecho %vcdir%\lib\mtxdm.lib >> msvc.tmpIF EXIST THREAD.res echo THREAD.res >> msvc.tmp%vcdir%\bin\link @msvc.tmp /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libcIF ERRORLEVEL 1 GOTO LINKERRORECHO * Application successfully built *D:LIMPIA.BATGOTO EXITECHOrem delete temporary files@del *.c@del msvc.tmp:COMPILEERROR@type comp.logECHO * Compiling errors *GOTO EXIT:LINKERRORECHO * Linking errors *GOTO EXIT:SINTAXECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRGECHO {-- Don't specify .PRG extensionGOTO EXIT:NOEXISTECHO The specified PRG THREAD does not exist:EXITpause
Muchas gracias!

Roberto Sánchez k:
Re: Multithread
pgfdz wrote:Ya me funcionó sin hacer nada. Como dicen los usuarios: Yo no he tocado nada. jejeje
Muchas gracias
son esos duendes

Que es mejor que programar? creo que nada 
Atropellada pero aqui ando
I love Fivewin
séʌǝɹ ןɐ ɐʇsǝ opunɯ ǝʇsǝ

Atropellada pero aqui ando

I love Fivewin
séʌǝɹ ןɐ ɐʇsǝ opunɯ ǝʇsǝ