MySQL user-defined function to send a Windows message

G'day,

I want to use the Postmessage () call of the Windows API from MySQL UDF in MySQL 5.1.51 (XP SP3). I know that UDF (written in Delphi 2006) works by setting a dummy result for UDF.

The UDF syntax takes two integer parameters: one for the window handle and one for the message number. However, calling PostMessage () from my UDF throws an exception in mysqld and the service stops.

Any ideas or pointers? Alternatively, if someone can tell me how I can simulate IB Events for MySQL via AnyDAC and Delphi OR an alternative approach to receiving notifications when a record has changed in the database, then please show me the light.

- Donovan

+1
mysql delphi user-defined-functions
source share
3 answers

As an alternative to Windows or TCP / IP messages, you may need a named pipes answer to this question when sending information between two Delphi programs and this question about which named pipes .

- Jeroen

+1
source share

You will have problems with this approach, mainly because messaging will only work at the same access level and in the same session on the same computer. You will be better off serving other methods like TCPIP sockets, MailSlots, memory mapped files, etc.

To best simulate a message, I would use TCPIP UDP . A nice easy library that I used in the past is Synapse . The SVN synapse library works pretty well against the latest versions of Delphi. The class you want to use for this is TUDPBlockSocket.

+2
source share

While I had success through the UDF / Windows Pipe route, I had another idea that enabled the use of the information message structure (?) In MySQL. See https://stackoverflow.com/q/3992779/223742

0
source share

All Articles