VINCENZO Posted July 15, 2021 Report Share Posted July 15, 2021 Hello, I have to create a vlib from a .dll. the dll has 5.h Is it possible to import all the .hs? it only makes me import 1.h Thank you Quote Link to comment
Rolf Kalbermatter Posted July 17, 2021 Report Share Posted July 17, 2021 On 7/15/2021 at 2:24 PM, VINCENZO said: Hello, I have to create a vlib from a .dll. the dll has 5.h Is it possible to import all the .hs? it only makes me import 1.h Thank you Generally you have one top level header file that declares the main APIs and then others that declare the datatypes and lower level APIs if any. In that case you point the import library wizard to the main header file and tell it in the additional include directory control where it can find the other header files. If you really have independent header files you can create a dummy master header file that includes all the individual header files and point the wizard to that dummy file. But, as I have pointed out many times, the import library wizard can't do magic despite its name. The C headers only define the bare bone datatype interface of functions nothing else. All the semantics about proper buffer handling, memory management, correct combination of multiple functions to create a real functionality is only documented (if at all) in the prosa of the documentation for the DLL library. No wizard can interpret random prosa text to extract these semantics out of it. You as programmer have to do it. This means that the VI library created by the import library wizard is almost always just a starting point for the real work. In the best case the API is very LabVIEW unfriendly (in LabVIEW you don't worry about first allocating a large enough buffer before calling a function, that is done automatically. A C DLL knows nothing about this type of things, respectively if it does its own management you are in even more trouble to call it from any non C environment, since there is absolutely no standard about how this management should be done and only in C(++) are you able to adapt to pretty much every thinkable management contract, no matter how crazy or überengineered it is. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.