Lazarus

Installation => Windows (32/64) => Topic started by: tech-pro on November 11, 2007, 02:32:13 pm

Title: Responding to Windows messages
Post by: tech-pro on November 11, 2007, 02:32:13 pm
My program is trying to make use of a third party Windows DLL that interfaces with the sound card and returns arrays of FFT data. I am unable to change the way the DLL works.

I have a Delphi example of how to use this DLL. When data is ready, the DLL sends a Windows message: MSG_DATARDY = WM_USER+1000;

In the Delphi example, the main form contains:

procedure FFTDataReady(var msg: TMessage); message MSG_DATARDY;

and there is a procedure FFTDataReady that then grabs the data and processes it. This procedure is never being called. Presumably there is a difference in the way Lazarus apps respond to messages. Can anyone help me out with this?
Title: RE: Responding to Windows messages
Post by: felipemdc on November 11, 2007, 08:26:11 pm
http://wiki.lazarus.freepascal.org/LCL_Defines#Win32_defines

You need to recompile LCL with PassWin32MessagesToLCL
Title: RE: Responding to Windows messages
Post by: tech-pro on November 12, 2007, 09:40:08 am
Thank you. It is recompiling as I type.

Since this is not enabled by default, is there a downside to this (bearing in mind this setting will apply to every program I compile using Lazarus)?

It worked - once I did a clean build of LCL.
Title: RE: Responding to Windows messages
Post by: Marc on November 12, 2007, 11:41:33 am
Yes there is a downside: it only works on windows
Title: RE: Responding to Windows messages
Post by: tech-pro on November 13, 2007, 01:16:52 am
So does the DLL, so that is no big deal.
TinyPortal © 2005-2018