Function calls to DLL stopped working with different versions of Ranorex

Ask general questions here.
User avatar
Bassem.Ibrahim
Posts: 4
Joined: Tue Nov 06, 2018 9:14 pm

Function calls to DLL stopped working with different versions of Ranorex

Post by Bassem.Ibrahim » Mon Mar 18, 2019 5:57 pm

Hello Ranorex Team,
I hope you are all well. We noticed an issue that seems to be caused by simply changing the Ranorex version. We have a DLL (publicly available) called MccDaq.dll that allows us to interface with Measurement computing's data logger hardware (USB-SSR24). During our upgrade from Ranorex version 8.0 to 8.3.2, we noticed that the function calls to the logger no longer work ( for example MccDaq.DaqDeviceManager.IgnoreInstaCal() ). The curious thing is that the upgrade to version 9.0 did fix the issue. Opening the solution in visual studio and looking at the DLL properties, you can see that the target framework of the DLL is v2.0.50727. The target of the Ranorex project is 4.6, so there should be no issues with that. The MccDaq.dll is the latest from measurement computing download website https://www.mccdaq.com/Software-Downloads.aspx : version 2.9.0.0

My concern is that the DLL will stop working in a subsequent version of Ranorex, that will have other features that we need in the future. This isn't an urgent problem since 9.0 is good, but I would like to bring it to your attention, for the very least being a technical curiosity. BTW, we did not need to upgrade to Ranorex 9.0, but in this case we had to.

P.S. I'm hoping ahoisl sees this post :)

ahoisl
Certified Professional
Certified Professional
Posts: 181
Joined: Fri Sep 07, 2007 8:16 am

Re: Function calls to DLL stopped working with different versions of Ranorex

Post by ahoisl » Mon Mar 18, 2019 10:22 pm

Bassem.Ibrahim wrote:
Mon Mar 18, 2019 5:57 pm
P.S. I'm hoping ahoisl sees this post :)
I did :D

Can you be a little more specific on "calls to the logger no longer work"? Do you get an exception or does the call go through without effect?

We fixed a problem with native DLL probing in Ranorex 8.3.3 and 9.0.0. So if you assembly is using a native DLL underneath, there's a good chance that this was the issued that caused the problem. I cannot imaging anything else that could break simple method calls.

Regards,
Alex
Ranorex Team

User avatar
Bassem.Ibrahim
Posts: 4
Joined: Tue Nov 06, 2018 9:14 pm

Re: Function calls to DLL stopped working with different versions of Ranorex

Post by Bassem.Ibrahim » Tue Mar 19, 2019 5:05 pm

Thanks Alex! The function calls to the Dll in 8.3.2 were causing an exception, so we could not communicate with or configure the hardware devices. After looking up what a native DLL is online ( :mrgreen: ) I suspect that the MccDAQ.dll does need to be running raw machine code to access the hardware directly.
I did not see any reference to the DLL probing fix (or any DLL related fixes) in the release notes of 8.x and 9, so I just wanted to bring it to your attention. But it looks like you were already aware.
Thanks for the affirmation. My best wishes to you all!

Cheers,
Bassem

P.S. how's the Glühwein this year?

ahoisl
Certified Professional
Certified Professional
Posts: 181
Joined: Fri Sep 07, 2007 8:16 am

Re: Function calls to DLL stopped working with different versions of Ranorex

Post by ahoisl » Tue Mar 19, 2019 5:38 pm

The problem with native DLL loading caused various effects and one could be that methods calling native DLLs - like you probably use them - would throw exceptions, e.g. that DLLs could not be found.

The release notes had the two following lines in there:
* Fixed a possible Qt AUT crash caused by Ranorex Studio changing the default native DLL search path
* Fixed an issue where running a test as an administrator would prevent the AUT from finding native DLLs

Regards,
Alex