From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to search path in exe?

Solved!
Go to solution

I have a project that have more class , so I dynamically obtain class by path.

I scan a folder , get all .lvclass, mapping name and get class what I want.

 

When build exe , I need include all subvi and class, I cannot have any "can modify code" in folder.

But if I include all , this dynamically obtain class will fail , it cannot scan file in .exe.

I was test , if use absolute path , it can work.

Example : [pwd]\Application.exe\OOP\Base Clase\Base Class.lvclass  , this path for "Get LV Class Default Value VI" can working.

 

I think a folder map in exe same with project. Is it true? 

How to scan folder map in exe?

Or have any mothed can auto scan and load class?

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

Not sure I understood your problem but if in executable you get errors when trying to dynamically load classes, make sure those clases are set to always included in build spec and set their destination outside of the exe (for example in the support directory).

Lucian
CLA
0 Kudos
Message 2 of 5
(1,553 Views)
Solution
Accepted by topic author Neroo

If you build them into your executable (which does have a directory structure), then use the Current VI's Path to build a path to where the classes are.

 

What I do is build my classes into Packed Project Libraries (PPLs) and put them in a special directory.  I use Application Folder to build a path to where the PPLs are and then use Get Exported File Path to get the exact path to the class inside of the PPL.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(1,539 Views)

It's a answer, but I need include in exe.

And thank you response.

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

Packed Project Libraries can support my need .

I save my class in lvlibp , main code can search path in lvlibp.
And lvlibp can lock code , user cannot see it.

 

Thank you for you information!

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