Page 1 of 2
Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 03:40
by sabinhagen
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.
Re: Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 09:17
by PEAK-Support
Check if the DLLs are placed in the correct directories - see
here
Re: Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 15:21
by sabinhagen
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.
Re: Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 15:31
by PEAK-Support
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

Re: Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 15:41
by sabinhagen
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!
Re: Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 15:45
by sabinhagen
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!
Re: Can't Load the PCAN-UDS.dll
Posted: Wed 19. Dec 2018, 15:48
by K.Wagner
Hello,
Just for information. Check the Project configuration when using Any CPU. See attached picture
Re: Can't Load the PCAN-UDS.dll
Posted: Fri 14. Jan 2022, 10:06
by Adn56
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.
It seems to be a dependency problem?
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.
Re: Can't Load the PCAN-UDS.dll
Posted: Fri 14. Jan 2022, 10:28
by PEAK-Support
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 ...
Re: Can't Load the PCAN-UDS.dll
Posted: Fri 14. Jan 2022, 11:50
by Adn56
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