I'm working on a component that should be shared between Delphi and C++Builder, so I'm using Pascal as the lingua franca. Because I don't have Delphi on my computer at home, I first created the component in the Lazarus IDE. Now I "ported" it to Delphi and found an astonishing syntax problem:
This compiles with FPC (but not Delphi):
FSync.FSyncMethod := @SyncCheckInput;
This compiles with Delphi (but not FPC):
FSync.FSyncMethod := SyncCheckInput;
How can I share a unit between Lazarus and Delphi despite this syntactic divergence?
TThreadand itsSynchronize()method: FreePascal Wiki | Multithreaded Application Tutorial | The TThread ClassApplication.QueueAsyncCallin Lazarus andPostMessageto an invisible Window (viaAllocateHWnd) in Delphi. Of course, I used theTThreadclass, butSynchronizewas not helpful in my case because of its rendezvous feature. Thanks anyway :)TThreadalso has an asynchronousQueue()method.Queuemethod in Delphi 4, that I have to use (I'm not sure, I've no D4 or its docs at hand now). So I better remove the sidenote from the question or be more specific about the versions I'm using?Queue()does not exist in D4. FreePascal mimics D7.