01-23-2024 05:01 AM
Hello,
I’m working on a project where I need to use a DLL useful for reading and writing to serial port.
I tried in every way to call the DLL through a server I wrote, always using LabWindows, but with the LoadLibrary command I get the error 126, that is "module not found".
In the various attempts at correction I have already tried to :
1) DLLEXPORT
2) Create a new project
3) Debugging in 32 and 64 bits
4) Check that the server worked with a DLL with only one print function (and it works)
5) Create a separate folder so you don’t have names that could create a conflict in the file search
6) Updated NI-Visa to version 21.5
Even searching online I do not understand what is wrong with my code because according to what I found in this community, it should work.
I am patiently waiting for someone to give me a hand in finding the solution to this mystery and I appreciate your answer ahead of time.
01-23-2024 05:46 AM
I don't understand your reference to VISA when you say you are trying to use a DLL.
If it's VISA functions you want to use, then you do not need to directly access the DLL: if VISA is installed in the system you'll find its functions in the Library menu.
Alternatively you could simply try using built-in RS232 functions.
Or you may actually need to call that specific dll, in which case please add some detail more.
01-23-2024 07:31 AM
If you have Visual Studio, you can use dumpbin to check if your required function is exported by the DLL.
dumpbin /exports filname.dll
01-24-2024 08:21 AM
Who created that "useful" DLL?
With what compiler and version?
Was it compiled as release version?
With C Runtime library as external dependency or compiled into the DLL?