Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

optionally loading DAQmx DLLs with Visual Studio c++

Does anyone know if it is possible to optionally load the DAQmx DLLs with a program written in Visual Studio C++?

The intent it to have this program, which is a command line utility, only need the National Instrument DLL's if it is being asked  to do something which requires them. This avoids loading the entire (1+GB) NI package when it is never being called.

0 Kudos
Message 1 of 5
(4,033 Views)

If you are programming in c++ you can choose to dynamically load the DLL's. These two links have some more information. 

 

https://msdn.microsoft.com/en-us/library/ms810279.aspx

http://stackoverflow.com/questions/8696653/dynamically-load-a-function-from-a-dll

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

0 Kudos
Message 2 of 5
(4,014 Views)

I had looked at the methods shown in the links but they appear to require that every call to a function in the DLL be changed so that it uses a function pointer. While it may be possible to change the application code to do this (not easy), it seems that in the NI system DLLs call DLLs which call DLLs. It does not seem that there is even any nice way to know what all the DLLs that will be required are. These methods seem to require that one knows what all the DLLs which call other DLLs also use dynamic loading. I assume that is not the case(or is it?)

0 Kudos
Message 3 of 5
(4,010 Views)

I don't think you'll need to know which DLL's call which DLL's. From my understanding, the actual loading process isn't any different than when it's done staticallly.  Also, I think if you use PDLL's mentioned at the bottom of the MSDN article, you shouldn't have to change all function calls to use a function pointer. 

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

0 Kudos
Message 4 of 5
(3,991 Views)

It looks like the the time needed to test this has vanished for the moment. Perhaps in a few weeks it can be tried and I will post the result.

0 Kudos
Message 5 of 5
(3,951 Views)