NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Calling DLL2 from DLL1 from TestStand

Jerry -
When DLL1 attempts to load another DLL2, the operating system finds the
subsidiary DLL2 using the standard DLL search algorithm, which the Windows SDK
documentation for the LoadLibrary function describes. The search precedence is
as follows:
1. The directory from which the user loads the application
2. The current working directory
3. Under Windows 95, the Windows system directory. Under Windows NT, the
Windows
system32 and system directories
4. The Windows directory
5. The directories listed in the PATH environment variable

When TestStand looks for a DLL called from a step, it uses the TestStand search
paths as defined in the Configure menu. Included in the search paths is an
option to use the standard DLL search algorithm.

So depending on where DLL2 is, what your search options are under TestStand,
DLL1 might not find DLL2. By calling DLL2 directly, you forced DLL2 into
memory, so DLL1 did not have to load it.

DLL2 can always be found in one of the following ways:
1) Place DLL2 into the system search path, i.e. C:\Windows\system(32).
2) Place DLL2 in the same directory as the executable, i.e. C:\TestStand\Bin
3) Place DLL2 in the same directory as DLL1.

Scott Richardson




jerry_gold

Please respond to "natinst.public.teststand.general@list.deja.com"


To: "natinst.public.teststand.general@list.deja.com"

cc: (bcc: Scott Richardson/AUS/NIC)
Subject: Calling DLL2 from DLL1 from TestStand



Message from the Deja.com forum:
natinst.public.teststand.general
Your subscription is set to individual email delivery

Hi,

I have a TestStand sequence that calls function1 provided by DLL1.dll,
which in turn calls function2 in DLL2.dll.

If my test sequence consists of a single action, 'Call function1 from
DLL1.dll', the sequence fails with the error message 'Could not load
DLL or external library DLL1.dll'

If I insert a new action BEFORE this action, 'Call function2 from
DLL2.dll', both DLLs load with no problem, and the sequence operates as
expected, except that I have an additional unwanted call to function2.

(This extra call loads DLL2.dll, so it is already in memory when
DLL1.dll is loaded, so the second load is successful)

I have managed to reproduce this problem with the following
configurations:

1. DLL1.dll and DLL2.dll are regular DLLs using MFC created with MSVC++
6.0.

2. DLL1.dll is a regular DLL using MFC created with MSVC++ 6.0, and
DLL2.dll is created with LabWindows/CVI 5.0.

Any ideas / suggestions as to how I can remove the initial call to
function2 are much appreciated.

Cheers,

Jerry


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



_____________________________________________________________
Deja.com: Share what you know. Learn what you don't.
http://www.deja.com/
* To modify or remove your subscription, go to
http://www.deja.com/edit_sub.xp?group=natinst.public.teststand.general
* Read this thread at
http://www.deja.com/thread/%3C7rnmlk%241lb%241%40nnrp1.deja.com%3E









Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 1 of 2
(4,041 Views)
This post is a reply to the question which is given in the post.
Anand Jain
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(4,041 Views)