LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find a path of loaded dll in dependencies

Solved!
Go to solution

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,

 

0 Kudos
Message 1 of 5
(1,189 Views)

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?

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(1,186 Views)
Solution
Accepted by topic author Redzouz1

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.) 

 

Kyle97330_0-1647968992918.png

 

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:

 

Kyle97330_1-1647969749675.png

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.

Message 3 of 5
(1,175 Views)

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,

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

@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.

Rolf Kalbermatter
My Blog
Message 5 of 5
(1,123 Views)