Can't Load the PCAN-UDS.dll

A free API for the communication with control devices according to UDS (ISO 14229-1)
sabinhagen
Posts: 6
Joined: Wed 19. Dec 2018, 03:29

Can't Load the PCAN-UDS.dll

Post by sabinhagen » Wed 19. Dec 2018, 03:40

Using a PCAN-USB-FD and have created a simple application using PCANBasic. Able to initialize a channel and use basic functions.

Tried to build a similarly simple app using PCAN-UDS.dll and the debugger says it cannot find PCAN-UDS.dll. I have all 3 dll files (Basic, ISO, and UDS) on my 64-bit Windows computer stored in the C:Windows\System32 folder, and I copied the 64-bit versions of each DLL.

I'm using Visual Studio 2017 and C#.

Any ideas why I can't seem to be able to load the PCAN-UDS.dll from my app?

Thanks.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Can't Load the PCAN-UDS.dll

Post by PEAK-Support » Wed 19. Dec 2018, 09:17

Check if the DLLs are placed in the correct directories - see here
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

sabinhagen
Posts: 6
Joined: Wed 19. Dec 2018, 03:29

Re: Can't Load the PCAN-UDS.dll

Post by sabinhagen » Wed 19. Dec 2018, 15:21

Yes, they are all in the System32 directory as I mentioned in my original post.

And the Basic DLL is read and works fine, but not the UDS.

Two different people on our team independently did this and found the same thing.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Can't Load the PCAN-UDS.dll

Post by PEAK-Support » Wed 19. Dec 2018, 15:31

You wrote that you use C# - this is based on the .NET Framework - so please also check if you have NOT setup explicit in your project to be a 32Bit Application.
If you sure that from your side all is OK - use our SystemInfo Tool , run a scan and send to support[at}peak-system.com. It works on thousends of customer PCs - why should it not work on yours :?:
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

sabinhagen
Posts: 6
Joined: Wed 19. Dec 2018, 03:29

Re: Can't Load the PCAN-UDS.dll

Post by sabinhagen » Wed 19. Dec 2018, 15:41

While you were posting your reply, I sent into System32 and pulled up property windows on each of the DLLs to make sure each was truly the 64-bit version, and that was all fine.

So I went into the SysWOW64 folder and sure enough, only found the BASIC dll file there. Verified it was the 32-bit version. So after copying the other 2 32-bit DLL files, the app worked! Which was is likely due to the thing you suggested looking into (although I haven't yet).

I know that we did not set a specific target (used the new project wizard), but perhaps the default is for 32-bit. But I didn't think that .NET targetted a specific 32/64 version in the app itself and simply let the OS determine that at runtime?

At any rate, we are running now!

Thank you for the quick response!
Last edited by sabinhagen on Wed 19. Dec 2018, 15:45, edited 1 time in total.

sabinhagen
Posts: 6
Joined: Wed 19. Dec 2018, 03:29

Re: Can't Load the PCAN-UDS.dll

Post by sabinhagen » Wed 19. Dec 2018, 15:45

Just for future users, I did find that Visual Studio has checkbox in the Build settings for Platform Target, and the checkbox is for Prefer 32-bit. On our systems, that box is checked by default.

On the other machine having the same issue, we will try to change that check box and see if that resolves the issue as we suspect it will.

Thanks again for the assistance!

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: Can't Load the PCAN-UDS.dll

Post by K.Wagner » Wed 19. Dec 2018, 15:48

Hello,

Just for information. Check the Project configuration when using Any CPU. See attached picture
Attachments
Configuration.PNG
Configuration.PNG (26.94 KiB) Viewed 8670 times
Best regards,
Keneth

Adn56
Posts: 6
Joined: Fri 14. Jan 2022, 09:27

Re: Can't Load the PCAN-UDS.dll

Post by Adn56 » Fri 14. Jan 2022, 10:06

Hello,
I have a strange problem with loading dlls.
My application works fine on 3 computers, but on the fourth one, it doesn't load 32 or 64 bit dlls.

Image

It seems to be a dependency problem?

Image

Do you have any idea?

config : Seven Pro 64bit pack 1. (Pcan ISO and UDS in the app directory but also 32bit in Wow64 and 64bit in sys32)

Best regards.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Can't Load the PCAN-UDS.dll

Post by PEAK-Support » Fri 14. Jan 2022, 10:28

Looks like you have mixed up any of the need DLLs (32Bit & 64Bit )
Simpy search on you System for this DLL´s - delete all of them - copy the needed one in the correct directory.
SysWow64 and System32 --> link
Also read the Thread here - it´s all explained ...
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Adn56
Posts: 6
Joined: Fri 14. Jan 2022, 09:27

Re: Can't Load the PCAN-UDS.dll

Post by Adn56 » Fri 14. Jan 2022, 11:50

Sorry, but it's done too:
On a 64-bit operating system, copy the 32-bit DLLs to c:\Windows\SysWoW64.
On a 64-bit operating system, copy the 64-bit DLLs into the c:\Windows\System32 directory.

For the other computers where my application works well, the DLLs are just placed in the debug with the executable (Dot.Net 4)
I don't understand why it works on 3 computers (seven and win10) and not for the fourth -_-

thank for help

Post Reply