Recent

Author Topic: Responding to Windows messages  (Read 5651 times)

tech-pro

  • Full Member
  • ***
  • Posts: 173
    • Tech-Pro.net
Responding to Windows messages
« 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?
Julian

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Responding to Windows messages
« Reply #1 on: November 11, 2007, 08:26:11 pm »
http://wiki.lazarus.freepascal.org/LCL_Defines#Win32_defines

You need to recompile LCL with PassWin32MessagesToLCL

tech-pro

  • Full Member
  • ***
  • Posts: 173
    • Tech-Pro.net
RE: Responding to Windows messages
« Reply #2 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.
Julian

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2583
RE: Responding to Windows messages
« Reply #3 on: November 12, 2007, 11:41:33 am »
Yes there is a downside: it only works on windows
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

tech-pro

  • Full Member
  • ***
  • Posts: 173
    • Tech-Pro.net
RE: Responding to Windows messages
« Reply #4 on: November 13, 2007, 01:16:52 am »
So does the DLL, so that is no big deal.
Julian

 

TinyPortal © 2005-2018