[Lazarus] Windows DDE

Daithi Haxton dave at haxton.org
Tue Nov 12 01:53:01 CET 2013

On Nov 9, 2013, at 11:52 AM, Ludo Brands wrote:
> afaik DDEInitialize is defined slightly different in Freepascal from  
> Delphi.
> This creates a valid DDE string handle for me:
> <snip>

Thanks, Ludo! It took me until today to try it, because I don't have a  
Windows machine at home, only Macs and Linux, and they don't do  
DDE ... Alas, when I got to work this morning, it didn't work ... your  
excellent sample returned the same kind of bogus data my routines were  
giving me.

However, it certainly put me on the path to solving the issue. I  
figured that if you said it worked, it must work - therefore the  
problem must be something else. A careful examination of the output  
from my DDE monitor revealed a strange "shifting" of data - the string  
handle was being returned as the task, and other things were "off". It  
finally dawned on me to look closer at the version of Lazarus and FPC  
I had installed - it was the 64 bit compiler. I happened to have a 64  
bit laptop and that's what I picked for installation and evaluation  
(back in June).  I reinstalled the latest from the website with the 32  
bit compiler and everything worked fine.... including your sample, of  

I don't know if this should be reported as a bug or not - I'm not sure  
that the Microsoft C compiler will correctly make these calls on  
Win64, either. We don't normally make 64 bit targets, so I will do  
some further investigations and let the list know. We're probably the  
only company on earth that still depends on DDE, but that was the   
last critical piece keeping us from shifting entirely to Lazarus and  
Free Pascal, and now that piece is in place. Goodbye MFC! ;>)

Thanks again and

Be well,
Dave H.

More information about the Lazarus mailing list