Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I have recently updated my winform desktop application from framework 4.0 to 4.6.1.
I have been using microsoft.windowsapicodepack.taskdialog for most of my pop up messagebox.

It is no longer working in 4.6.1.
I have got the System.OverflowException: 'Arithmetic operation resulted in an overflow.' error, during td.show.


This is what I know, the error is only happening if I build the project in 64 bit, no problem found in 32 bit.
Also the error only happens when I add my own custom controls.
td.controls.add(commandlink1).
If I don't add any controls, it is still working, even in 64 bit.

Is there any workaround or solution for this?
Thank you so much

What I have tried:

td = New TaskDialog() 
td.InstructionText = "my question"
td.Caption = "my tile"
td.StandardButtons = TaskDialogStandardButtons.Yes Or TaskDialogStandardButtons.No
td.Text = "question caption"
td.Icon = TaskDialogStandardIcon.None
td.StartupLocation = TaskDialogStartupLocation.CenterScreen

cl1 = New TaskDialogCommandLink("cl1", "Option 1", "Caption 1")
cl2 = New TaskDialogCommandLink("cl2", "Option 2", "Caption 2")

td.Controls.Add(cl1)
td.Controls.Add(cl2)

td.OwnerWindowHandle = currentform.Handle
td.show()
Posted
Updated 26-Jul-20 20:10pm
v2
Comments
Sandeep Mewara 27-Jul-20 1:47am    
Did you try: https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Core/
ekograce 27-Jul-20 2:08am    
Sandeep, thank you so much, solved :)
I was using version 1.0.0.
Sandeep Mewara 27-Jul-20 2:09am    
Cool - I will add that as an answer for the closure of question.

1 solution

Try using the newer version of WindowsAPICodePack and that should help solve your issue.

New WindowsAPICodePack that supports .NET framework v4.6.1: NuGet Gallery | Microsoft-WindowsAPICodePack-Core 1.1.4[^]

Try out!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900