LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 9.0. Need an UIR-Element, his function is contain some files.

Hello.

 

I neet to put in program 2 files. When program is launched and pressed some button - extract files from this Element and run it.

 

If this Element is not exist in CVI - how put in program some outside files and work with files?

 

Question 2: CVI have analog of command of VB6 "On Error" or not?

0 Kudos
Message 1 of 8
(3,320 Views)

Hi ,

 

You need to extract the files ( zip , rar ... ) or just launch them ?

 

What type of file , exe or other ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 2 of 8
(3,317 Views)

Files is .REG and .BAT. Zip and unzip is not required. I need to include files at the program with possibility extract files in the temp.

0 Kudos
Message 3 of 8
(3,311 Views)

If these two files are always the same and don't change from distribution to distribution one possible though not very elegant solution might be to generate the files using regular fprintf statements

0 Kudos
Message 4 of 8
(3,301 Views)

OK ,

 

For the .bat files you can use 

 

1. int system (const char command[]); - will run your .bat an wait until the .bat exits.

2. int LaunchExecutable (char filename[]); - will run your .bat an wont wait until the .bat exits. 

 

For the .reg files simply use int OpenDocumentInDefaultViewer (const char documentFilename[], int windowDisplay);

it's like doing a double click in on  a file in the explorer.

 

Hope it helps....

 

 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 5 of 8
(3,233 Views)

Mmm... See...

 

I know, how to launch files.

 

I don't know how include files in the program. I don't want to put this files in the HDD, i want to keep files in the program until click the button.

 

In VB6 it's realized some that:

http://www.intuit.ru/department/itmngt/workinmsvistudio/17/10-01.jpg

 

Imagination: images - it is files. Files puts in container in "uir" panel. And keeps. No HDD, no memory, on body of program only.

 

How to create them in CVI?

 

0 Kudos
Message 6 of 8
(3,230 Views)

I see ,

 

Well i don't know about .img files system or some thing like that , but...

 

If you need only .reg and .bat , then simply make the files from the code ,

 

for example if you want to create a .bat file to open "calc.exe" then save this as a string ,create a .bat file and then put the string in to it...

 

same for .reg , save strings and create the files your own....

 

if it's not your files and you can't create them then maybe some one from NI will know better...

 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 7 of 8
(3,227 Views)

Some steps.

 

In UIR click right button -> "ActiveX..." -> Create from file (choose file .reg).

 

But how to extract file from this element?

0 Kudos
Message 8 of 8
(3,212 Views)