08-30-2019 10:44 PM
I called lvanlys.dll in C++, and then I want to use the BWCoefs90 function in this dll. This error occurs at runtime. Is there any way to solve it?
best regard
09-05-2019 02:58 AM
You can use "LabVIEW Manager Functions" to call exteranl C/C++ code.
You should include header file extcode.h and link to labview.lib
There is steps to call it in the link below.
LabVIEW Manager Functions
http://zone.ni.com/reference/en-XX/help/371361J-01/lvexcode/labview_manager_functions/
09-20-2019 05:18 AM - edited 09-20-2019 05:25 AM
@freeown wrote:
You can use "LabVIEW Manager Functions" to call exteranl C/C++ code.
You should include header file extcode.h and link to labview.lib
There is steps to call it in the link below.
LabVIEW Manager Functions
http://zone.ni.com/reference/en-XX/help/371361J-01/lvexcode/labview_manager_functions/
I don't think this addresses the OPs problem at all. lvanlys.dll is a DLL specifically created for use with LabVIEW. Aside from license issues there are technical issues that make use of this DLL from other environments than LabVIEW pretty hard or even impossible.
The calling interface of many of these functions is specifically adapted to be LabVIEW friendly. This means that it does use LabVIEW handles for arrays and possibly strings rather than C pointers. Now in order to deal with LabVIEW handles you need to have a runtime kernel that can create, resize and deallocate them and your application and the called DLL need to agree on which runtime kernel they use. When this DLL is called from a LabVIEW context, be it the development environment or a build LabVIEW application, the DLL will detect that and simply link to the LabVIEW kernel of the calling application.
For a non-LabVIEW application it is a lot more complicated. You also have to find and load the according LabVIEW runtime library on your machine and then diligently use its provided memory manager functions to prepare any handle input to the called function and deallocate any handle afterwards with these functions. If you don't do that lvanlys.dll can not link to the lvrt.dll runtime for handling of handle parameters. However, locating a correct lvrt.dll on your machine is no easy feat. Just copying it into your application directory and trying to load it from there won't work either since the lvrt.dll has many dependencies that are located in a full LabVIEW Runtime Engine install. And just installing that engine and refering to it with fixed paths will quickly fall flat on its face when you try to install this on a different computer.
Remains the question why the OP really thinks he should try to call lvanlys.dll. This is not a public LabVIEW library meant to be used outside of LabVIEW. It is also not the real analysis library either but mostly a LabVIEW friendly wrapper for the Intel Math Kernel Library (MKL) that NI distributes with its products. If you want to use this functionality in other products you would be better advised to simply use the MKL directly.