Hi Vinnayak
What programming language do you use? If it’s a LabVIEW, this would be tricky to work around. When LabVIEW loads (not executes) a VI, it also loads all dependent DLLs to check, if they are all executable. That way you avoid crashes or hangs if the VI already runs and then it turns out that a particular DLL is missing or doesn’t provide the required function. You can observe this, when you open LabVIEW (nothing else open) and drop a CAN (or DAQmx) VI on the diagram. There is a small delay before the VI actually gets onto the diagram which is caused by loading the required ‘DLL chain’.
If you know, that you are not going to execute any code that calls into the NI-CAN DLLs, you could create a stub DLL that provides all the function declarations (ncOpen(), ncClose(), etc.) that your VI calls, but has no code in it.
This is quite a bit of work, depending how many different functions are used.
If you are not using LabVIEW, you could load the NI-CAN functions dynamically using the Win32 functions getProcAddr() and loadLibrary(). That way the NI-CAN DLL is only loaded when it is actually used.
Copying individual DLLs will not work as the NI-CAN driver DLLs not only depend their own Win32 service, but other services running which in turn have their own dependencies.
-B2k