08-17-2011 02:30 AM
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?
08-17-2011 02:44 AM
Hi ,
You need to extract the files ( zip , rar ... ) or just launch them ?
What type of file , exe or other ?
08-17-2011 04:43 AM
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.
08-17-2011 06:08 AM
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
08-17-2011 06:10 AM
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....
08-17-2011 06:40 AM
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?
08-17-2011 07:05 AM
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...
08-18-2011 12:14 AM
Some steps.
In UIR click right button -> "ActiveX..." -> Create from file (choose file .reg).
But how to extract file from this element?