Hi
We’re having issues when calling Aspose.Cell in our application through a CLR wrapper in some contexts
When generating a chart the call to Aspose.Cells.Charts.Chart.ToImage generates the following exception
Unhandled Exception: System.ArithmeticException: Overflow or underflow in the arithmetic operation.
…
at Aspose.Cells.Charts.Chart.ToImage(Stream stream, ImageOrPrintOptions options)
More specifically we have a GUI application built using C++ Builder XE3 from Embarcadero, which then calls a MSVC C/C++ library that then call a CLR wrapper which handles all the calls to Aspose
I’ve reproduced the issue in a set of simplified standalone applications and libraries, in the attached zip file.
The workflow is
1- Project1.exe (the C++ Builder project)
2- AposeCLRLib.dll (a Visual Studio C++ project that is CLR compatible and compiled using stdcall calling convention that exports 1 function and uses the next item)
3- AposeLib.dll (A .NET library that acts as a wrapper and calls the Aspose libary)
I’m not sure where the issue is exactly but I’m hoping that with that information you can reproduce the issue and either fix the issue or provide more information as to any possible workarounds
Other information I can give you is that usually calling Aspose.Cells.Charts.Chart.ToImage once, catching the exception and then calling it again works for some reason, but it’s not a viable long term solution
Also avoiding Embarcadero projects altogether by calling the CLR dll within other Visual Studio projects works fine but again this is not something I can replace or change.
I’m guessing something is not being initialized properly somewhere but without more information of the root cause of the exception it’s really hard to tell
We use the same sequence with other .NET libraries without issues so I don’t know if Aspose requires something our other libraries don’t or if I just missed something along the way.
Thank you for your help
Hi,
Hi,
I still have the issue when using Aspose.Cells16.10.8.0 you provided
Did you do any other changes beside changing the reference to Aspose?
Did you use the provided Project1.exe file when doing your test?
Here’s what I’m seeing
E:\CompiledAndReadyToRun_v2_UsingAposeCells16.10.8.0>Project1.exe
Loading AsposeCLRLib.dll
GetProcAddress for GenerateChartExtC
Calling aspose CLR lib wrapper
Aspose Version Info: 16.10.8.0
Unhandled Exception: System.ArithmeticException: Overflow or underflow in the arithmetic operation.
at .( , Single , Single , Boolean)
at .( , Int32 , Int32 , Boolean)
at .(? )
at .(? )
at ? ? ?()
at .? ?()
at ? .(Stream , Chart )
at Aspose.Cells.Charts.Chart.ToImage(Stream stream, ImageOrPrintOptions options)
at Aspose.Cells.Charts.Chart.ToImage(String imageFile, ImageOrPrintOptions options)
at AsposeLib.MyChart.GenerateChartData()
at GenerateChartExtC()
I added a call to CellsHelper.GetVersion() to make sure the right version was used, I’ve attached an updated version of the files I initially provided with those adjustments
Thank you
Hi,
Of course this works, I already said so in my initial post
Luc Charbonneau:
Avoiding Embarcadero projects
altogether by calling the CLR dll within other Visual Studio projects
works fine but again this is not something I can replace or change.
My issue is only when a C++ Builder XE3 project is involed in the call sequence, but since that same sequence is used to call multiple other managed .NET libraries without issues I have no idea why it doesn’t work with Aspose.Cell
To reproduce the issue the project in “EmbarcaderoRadStudioXE3Project” must be used (or the resulting Project1.exe)
Hi,
It works with that new version thank you
The issues you have found earlier (filed as CELLSNET-44893) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.