critical error with my_element.dll

https://www.dacm-logiciels.fr/tracewin
Post Reply
Francesmorard
Novice
Novice
Posts: 3
Joined: Fri 6 Mar 2026 13:47
Country:
France (fr)
France

critical error with my_element.dll

Post by Francesmorard »

Dear Didier,

When running my project with my own element in the file my_element.dll, it works only the first try when TraceWin is starting. If I run it a few times because I changed some parameters or something I end up with an error message saying there is a critical error and TraceWin is becoming unstable, then it crash.

I encounter this problem since I'm using Windows, I didn't have this problem with this file under linux format '.so'.

Thanks in advance for your help.
Sophie
Attachments
MEBT.dat
(1.2 KiB) Downloaded 3 times
output_RFQ.dst
(3.84 MiB) Downloaded 1 time
my_elements.dll
(123.14 KiB) Downloaded 3 times
MEBT.ini
(43.77 KiB) Downloaded 2 times
MEBT.cal
(315 Bytes) Downloaded 2 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 1217
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: critical error with my_element.dll

Post by FranceDidier »

Dear Sophie,

I’ve made some improvements to the DLL format validation in Windows, and using your example, with the new version of TraceWin I now get the message “Is not a valid Win32 application.”
This probably means that the DLL has been built incorrectly or that it calls on 32-bit DLLs when it should be compiled as 64-bit. I can’t say for sure at this stage, but what is certain is that the DLL I provided as an example with the code works. So if you could send me the code for your DLL, I’ll try compiling it myself and perhaps I’ll be able to figure out the problem.

In first time upgrade TraceWin to check, if you have the same message.

Regards,

Didier
Francesmorard
Novice
Novice
Posts: 3
Joined: Fri 6 Mar 2026 13:47
Country:
France (fr)
France

Re: critical error with my_element.dll

Post by Francesmorard »

Dear Didier,

I don't have any new update available on TraceWin, so I can't test.
I don't remember how I compile the DLL first time so I did it again in 64-bits for sure. You can find the new version attached to this message.

Best regards,
Sophie
Attachments
my_elements.dll
(378.37 KiB) Downloaded 2 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 1217
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: critical error with my_element.dll

Post by FranceDidier »

Dear Sophie,

I’ve further improved the detection of issues when loading Windows DLLs by adding dependency detection and checks to ensure they’re present. So, with the latest version of TraceWin (I’ve actually updated it on the website this time), I get the following message when using your DLL:

Code: Select all

Following error occurred :

'[my_elements.dll]

The specified module cannot be found.

libwinpthread-1.dll : Missing dll

From->[ELEMENTS] : My element envelope:Element :16
From->[Calc] : Ref particle transport'
One dll is missing': "libwinpthread-1.dll"
How did you compile it? Which compiler and which options did you use? Could you tell me your command line?
Post Reply