CallBack function in C Libraries.

fiensproto at gmail.com fiensproto at gmail.com
Fri Mar 21 20:22:02 EDT 2014


Le vendredi 21 mars 2014 16:50:18 UTC, Mark H. Harris a écrit :
> > def TheProc():         <================== you moved c_int from here ...
> 
> >      fpgui.fpgFormWindowTitle(0, 'Boum')
> 
> >      return 0

> > CMPFUNC = CFUNCTYPE(c_int)   <============ and placed it here ...

> 
> 
> ... it wasn't "expecting" exactly one parameter. So, your python 
> 
> traceback no longer warns about the parameter 'mismatch' in the defined 
> 
> function  TheProc().
> 
> 
> 
>     I'm not picking on you, but this error was obvious; as was it's 
> 
> solution, so I'm just wondering ?
> 

Hello and thanks for answer.

Hum, i do not understand why, but the code is working ... ;-)

Some remarks :

> def TheProc():   
>      fpgui.fpgFormWindowTitle(0, 'Boum')
>      return 0        <================== that does the trick...


And 

> > CMPFUNC = CFUNCTYPE(c_int)   <======== 1 argument minimum..

It seems that CFUNCTYPE() want minimum 1 argument, even if TheProc() is a simple procedure, without argument...

Hum, it is my really first program in Python and im impressed how easy it was to do my Pascal (fpc) library work!
Im busy to try to do it work for java programs but it is not so easy.

By the way, is it possible to hide the terminal-window ?

That library is a complete graphic widget set (from Form to Stringgrid and more).
So, i will prefer that the console was hided...

And last question, how to retrieve the directory of the main Python application ?

Many thanks.



More information about the Python-list mailing list