04-01-2014
03:45 AM
- last edited on
12-03-2024
10:57 AM
by
Content Cleaner
Hello,
I am focused with a strange behaviour which i could not explain.
I had to extend the NI272x in my C++ unmanaged environment for a StepType http://sine.ni.com/cs/app/doc/p/id/cs-11443/lang/de/pdf/yes/pdf that descripes a functional testsystem.
Unfortuanately NI provieds no C Api for this devices. But LabView drivers were available. So i made LabView Wrapper
to consume it. This is worked fine.
A current extension development is done in C#. It loads the old unmanaged StepType-Dll during runtime. If the LabView Dll is
used. I am not able to load the DLL with C# via SDK LoadLibrary to memory.
To understand whats going on i have provied a small project that descripes the task.
Regards
Juergen
Solved! Go to Solution.
04-01-2014 09:43 AM
I believe the problem is that the dll you are loading has dependent dlls. The normal behavior of LoadLibrary does NOT automatically look for dependent dlls in the same directory as the dll you are loading. You should use LoadLibraryEx with the LOAD_WITH_ALTERED_SEARCH_PATH option instead (This is what teststand uses when loading dlls with the c++ adapter). See Microsoft's help info on MSDN for more details about LoadLibraryEx and LOAD_WITH_ALTERED_SEARCH_PATH.
Hope this helps,
-Doug
04-02-2014 05:23 AM