Autore Topic: Gestire un thread Watch/notifier in esecuzione in una libreria esterna  (Letto 314 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.269
  • Ne mors quidem nos iunget
    • Mostra profilo
Vi segnalo questa discussione apparsa nella Mailing List ufficiale:


"Gambas is very capable of interfacing with external libraries, as
documented in:
http://gambasdoc.org/help/howto/extern?v3

I got it all working fine, i can call a function inside the library and i
get a value back (if there is a return value in the function).

Only I want something else now ... Within the library there is a
watch/notifier thread running which captures data from the serialport. This
data comes in independantly from the calls done to the library.

Is it possible to define a hook in Gambas (or the library) that the library
can initiate calls and push information to the main Gambas application?
Thus without having to call a certain function to poll the data, i want to
have it pushed from the library.

Regards,
Alex
"


" You can use any gambas function as callback *provided that the callback
is called in the main thread and not in another thread*.

Regards,

--
Benoît Minisini
"


" Hi Benoit,

Ok, found an example on the following link:
http://www.gambasdoc.org/help/lang/extdecl?v3

Will try it out :)
Alex
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.269
  • Ne mors quidem nos iunget
    • Mostra profilo
Re: Gestire un thread Watch/notifier in esecuzione in una libreria esterna
« Risposta #1 il: 11 Novembre 2013, 19:40:07 »
Segnalo anche questa discussione presente nel nostro forum:

http://www.gambas-it.org/smf/index.php?topic=2823.0
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »