Stevo_ie has asked for the wisdom of the Perl Monks concerning the following question:

My problem is as follows: I'm accessing a device which sends a message to a specified window about status changes, I'm new to Perl and so don't know how to read or catch this message sent. The device is a SmartCard reader which comes with its own drivers, it's dlls are used to access it. Calling a function from the smartcard dll allows you to setup the window messaging, you give it a window handle and when a card is either inserted or removed the dll will send a message to that window. Any window handle can be given. I'm using Tk on the latest version of Perl on Win2000. If you need more info then I'll try to give more details. Thank you for your time. Stevo_ie

Replies are listed 'Best First'.
Re: Window Messaging
by mattr (Curate) on Jun 13, 2001 at 16:13 UTC
    Is there no other way to talk to that device than window messaging? Wierd.. I wouldn't normally use window messaging to control a device. Could you copy into Tk::Clipboard?
Re: Window Messaging
by bikeNomad (Priest) on Jun 13, 2001 at 20:16 UTC
    You might be able to use Inline to do this by opening a separate hidden window and forking off a thread to handle its messages (in C or C++). Incoming messages could then signal your main program. Inline works with Event, so you can define your own events and still be compatible with the Tk message loop.

    update: just started playing with Event again, and it appears that Event isn't compatible with Tk, just with PerlQt. Anyway, the suggestion about the separate thread is still potentially useful.

      Thank you for your response