You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
First, I'd like to thank you for your library. I've been using it for some time with great success.
Recently I changed all of my WinForms applications to 64-bit versions.
After that TaskDialogs stopped working.
Showing of a simple dialog still works, but you can't change any of the properties of a dialog that is already shown. Application is failing with System.OverflowException.
I tracked the problem to windows message loop procedure and message class itself.
Currently Message class has WParam and LParam properties defined as int (32bit) and that is causing problems.
Setting a new property value actually sends new windows message, so for example:
There is a Message class constructor that takes string as a parameter.
It uses Marshal runtime to get a pointer (IntPtr) to character data and it tries to assing that value to LParam - which is 32bit int. That results in an overflow exception.
It seems that the problem is easily solved by changing type of WParam and LParam properties to IntPtr - a type whose size is platform dependent, just like the underlying WPARAM and LPARAM types from WinAPI.
I could submit a pull request for this change, but I don't have any experience with creating configuration for multi-platform NuGet packages and I don't know how a new package configuration should look.
Best regards
Piotr Zięzio
The text was updated successfully, but these errors were encountered:
pziezio
changed the title
Support for 64-bit compilation
Change message WParam and LParam properties to IntPtr for x64 support
Nov 21, 2018
Hello @pziezio,
sorry for the late reply, thank you for the heads up and for the detailed explanation: the issue should now be fixed. I included the suggested changes in this commit (which preserves the authorship of your suggestions).
I'll try to pack up the changes in a NuGet update as soon as possible.
Hello,
First, I'd like to thank you for your library. I've been using it for some time with great success.
Recently I changed all of my WinForms applications to 64-bit versions.
After that TaskDialogs stopped working.
Showing of a simple dialog still works, but you can't change any of the properties of a dialog that is already shown. Application is failing with System.OverflowException.
I tracked the problem to windows message loop procedure and message class itself.
Currently Message class has WParam and LParam properties defined as int (32bit) and that is causing problems.
Setting a new property value actually sends new windows message, so for example:
There is a Message class constructor that takes string as a parameter.
It uses Marshal runtime to get a pointer (IntPtr) to character data and it tries to assing that value to LParam - which is 32bit int. That results in an overflow exception.
It seems that the problem is easily solved by changing type of WParam and LParam properties to IntPtr - a type whose size is platform dependent, just like the underlying WPARAM and LPARAM types from WinAPI.
Please take a look at the following changes that I made:
https://github.com/pziezio/WindowsFormsAero/commit/0a4cef194d40760f58e10427e1bb8b41c5b0d854#diff-3d7d9b2fdd0df5be3ed6890538248201
I could submit a pull request for this change, but I don't have any experience with creating configuration for multi-platform NuGet packages and I don't know how a new package configuration should look.
Best regards
Piotr Zięzio
The text was updated successfully, but these errors were encountered: