03-22-2022 11:56 AM
Good morning community,
I have a simple question. I have DLL (FileX.dll) loaded in my project. Do you have a way to retrieve its path by its name ?
For *.vi there a methods that returns all the VIs loaded in memory. I would like to do the same for the DLL.
In c++ there is this method: GetModuleHandleExA function (libloaderapi.h) - Win32 apps | Microsoft Docs
Probably there is something similar in LabVIEW ?
Please before replying, the question is not why I need this ? but how I do this ? Thanks for your understanding.
Kind regards,
Solved! Go to Solution.
03-22-2022 12:05 PM - edited 03-22-2022 12:07 PM
What do you see when you go into the menu Project->Show Item Paths and then expand the project tree to show you the DLL item in the tree?
03-22-2022 12:25 PM
If it's only in your project, then you need to open a reference to that project with the Project.Open invoke node and then use its properties to check what's in the project (recursively, to look in all the folders, libraries, etc.)
If it's a dependency of a loaded VI, and you want to check like that, then I think you need to get a reference to all loaded VIs, like you already do, then use scripting to check the dependencies of all nodes within them:
The "This VI" reference in the above screenshot being replaced with an "open VI reference" node in a loop iterating through the output of the "All loaded VIs" node you already know about. Then probably also add code to discard dependencies that aren't DLLs.
There might be other ways but this is the one I have used and the only one I found.
03-23-2022 03:46 AM
Thank you very much Kyle97330. I add the DLL in the project and used the 1st solution. It works well !
For the second solution, I don't have that addon (GObject).
Kind regards,
03-23-2022 06:36 AM
@Redzouz1 wrote:
For the second solution, I don't have that addon (GObject).
The blue properties are scripting functionality. You need to enable that in the LabVIEW Options:
VI Server->Show VI Scripting functions. properties, and methods
This is disabled by default as it adds many extra properties and methods to various object classes and that would only make new users confused.