@jamie
I’ve just compiled and run my application in 32-bit mode on Windows 7 64-bit, and now the events are being triggered correctly.
So it works!
This leads me to believe that PascalScript indeed uses 32-bit method pointers internally, which causes problems when running in 64-bit mode — especially for event handlers (like OnClick).
Thanks a lot for the helpful hints and confirmations!
Best regards,
Maurog
However, if the host is 64-bit, the button click is not detected or executedFor this reason, I refused to create a GUI on the script side in 64-bit applications. Pascal Script is used to save and then run the host program, which includes many settings for initial and boundary conditions of modeling, saving intermediate results at specified times, and data visualization, among other features. In other words, the user does not need to enter a lot of initial data and settings; he just runs the script, which is useful when performing serial calculations.
However, if the host is 64-bit, the button click is not detected or executedFor this reason, I refused to create a GUI on the script side in 64-bit applications.
Newer versions of Delphi have some API to make calls using RTTI... I don't know what is avail in FPC 3.3.1 (and I heard somewhere it may need some so/dll - but I may have mistaken something else).
If I understand this correctly, Lazarus/FPC uses its own port of PascalScript, and this 64-bit fix is currently not enabled or integrated there.
Therefore, it seems that the FPC/Lazarus port may need to be adjusted or tested so that GUI events work correctly in 64-bit applications.
86a057c8686143ce0443be6995d6515c5c9b705c
* 1)InvokeCall added, instead of all different callers (x86, x64, powerpc etc) for Delphi 2010+. (#207)
Hi
The suggestion above to solve this problem is a workaround. It consisted of writing wrappers and registering in the script engine for the host program procedures that ran additional event handler scripts. This is not very convenient. After getting to know the PascalScript source code a little, you can find another solution. The attached project shows the idea of registering handlers that can be created in the main script code using a simple example.
The functionality has been tested using Lazarus 3.4; FPC 3.2.2 on Win32, Win64, and Deb64.
estas granda plezuro renkonti iun, kiu scias esperanton.
So when I find time, I may merge them into 4.99.
O https://github.com/pult
helped me use this fork: https://github.com/pult/pascalscript
, in which the issue with x64 events started to work correctly.
estas granda plezuro renkonti iun, kiu scias esperanton.
en: it's a great pleasure to meet someone who knows esperanto
If the commit you look for isQuote86a057c8686143ce0443be6995d6515c5c9b705c
* 1)InvokeCall added, instead of all different callers (x86, x64, powerpc etc) for Delphi 2010+. (#207)
then I don't know if it will work... From hear say, if at all then only with fpc 3.3.1, and potentially some extra conditions on top (but I have no idea).