For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > June 2005 > [VW 7.1] Callbacks









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [VW 7.1] Callbacks
stalk

2005-06-03, 3:58 am

Can I register with a DLL for callbacks?

For instance, a DLL provides a service to clients that want to know when a
file arrives in an archive. Can I use the DLL from within VW to register
interest and receive notification?


Reinout Heeck

2005-06-03, 9:08 am

stalk wrote:
> Can I register with a DLL for callbacks?
>
> For instance, a DLL provides a service to clients that want to know when a
> file arrives in an archive. Can I use the DLL from within VW to register
> interest and receive notification?
>
>


Yes.
In your docs in the DLLandCConnectGuide.pdf chapter 4 is devoted to
'Calling Smalltalk from C' this includes setting up callbacks.

It is all pretty straightforward:

Declare it:
1) In DLLCC declare the signature of the registered user function
2) declare the signature of the C callback registration function.

Use it:
3) pass a Smalltalk block to that registration function.
4) do stuff so it gets called....


And yes, you can put a 'self halt' in the registered callback :-)))





R
-
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com