01-06-2009 03:30 AM
Hi,
I made a DLL with LabWindowsCVI and it works fine.
I'm loading this DLL on a VB.NET program.
The problem is: when I use it on my computer or on a computer with LabWindows, LabVIEW, Visual Studio, etc, it works; But if I use the program on a computer with no NI software I get the error HRESULT 0x8007007E LoadLibrary failed, canot find module...
Why can't I use a NI DLL on a computer with no NI software? Or is it another problem?
I apreciate all the help, because I'm already on this for a few days.
Regards,
Daniel Coelho
Solved! Go to Solution.
01-06-2009 04:36 AM
Because the dll needs the support of the CVI run-time environment. Just create a distribution kit for the dll project and that should ensure that all dependancies are taken care of.
JR
01-06-2009 04:46 AM
01-06-2009 05:33 AM
I managed to do the distribution kit.
It works.
Is there any other way to do it?
Because I'm using Visual Basic 2008 to call this DLL and this program has its own distribution kit...
It gets a bit messy to install the runtime environment and my program and another program I need too...
Since the DLL has only normal C, it doesn't have any NI libraries, can this dll be compiled on LabWindows without needing the runtime environment?
01-06-2009 06:05 AM
If your dll does not use any NI facilities then maybe you should generate it using MS Visual Studio (or whatever your favourite compiler is) instead of CVI. Then the dll would be standalone and not need any CVI components. I'm not aware of any way to remove the runtime dependancy from a CVI compiled dll.
JR
01-06-2009 06:09 AM
That's what I'm already doing.
But on LabWindows was a bit simpler.
Thanks for your time.
Regards,
Daniel Coelho
01-06-2009 10:49 AM
Hello Daniel,
If VB's distribution mechanism allows you to import merge modules (.msm files) into your distribution, then you could simply include the merge module for the CVI runtime in your VB distribution. You can find it here:
C:\Program Files\Common Files\Merge Modules\cvirte_core.msm
Keep in mind that adding this file is sufficient insofar as you are not using NI libraries besides the ANSI C library. If you do start using some other CVI libraries depending on which ones you use, you might have to add some additional files (most libraries do not require additional runtime support).
Also, if you change your linkage in CVI (Build>>Target Settings>>Run-time support) from "Full run-time engine" to "Instrument driver only", which you can do since you're using only a limited set of CVI functions, and it will make your distribution smaller, then you will need to replace the file above with:
C:\Program Files\Common Files\Merge Modules\instrsup.msm
Luis