05-26-2012 12:31 AM
Hello.
I wrote a small program that buld template project in cvi. (I use cvi api functions - cvisrvr);
Program steps:
1. Open new cvi (CVI_NewApp).
2. Save Project (CVI_AppSaveProject).
3. Create a few new *.c files and add them to project.
4. Build.
5. Exit.(CVI_AppExitCVI (cviAutoObj, NULL, 0, &ReturnValue); )
The question:
When i run step 5, I cannot finsh this step because i must save a workspace.
How can i programaticaly or throw api functions can save a workspace?
Boris
05-29-2012 01:08 PM
06-06-2012 07:43 AM
Hello
Sorry bu both function not working.
CVI_AppSaveFile - not allowed to save *.cws files.
CVI_AppSaveAll - promt me dialog for insert a name for wokspace. (It is my problem).
I need a function like (create_workspace or save_carent_workspace or etc....).
Today, i cannot automatically create a template project for my customers.
My program stucked on step 4 (build project) and/or step 5 (exit from cvi).
After many of working days on this application i need any solution.
Thanks
Best Regard
Boris
06-08-2012 02:49 PM
It looks like there isn't an easy way to save a workspace without having the prompt for the name of the workspace show up. A work around is to programmatically create a text file with the file extension ".cws". If you open a blank .cws file in notepad, you will see information about what is in the workspace. Add that information to the text file you create programmatically in CVI. CVI_AppSaveAll should not prompt for the user to give it a name.
06-09-2012 11:17 AM
Hello Rohama K.
What is the best way to create a sample project in CVI using API.
Could you please write me step by step similar to what I wrote at the beginning how I can implement the construction project through the API. Where in the steps I wrote above, I have to create the file CWS and how to attach the project to him? How i open CVI if i create a cws file at begining?
Thank you
and Best Regards Boris
06-11-2012 03:59 PM
Hi,
1. Create .cws file:
fp=fopen("<path to save>\\NameOfWorkspace.cws", "w");
2. Write information to the file so that it has the minimum information to open it in CVI:
fprintf(fp, "[Workspace Header]\nActive Project = 1\nNumber of Projects = 1\nVersion = 1001");
3. Open CVI Workspace: CVI_NewApp
4. Add the new .c files
5. Save workspace: CVI_AppSaveAll
6. Exit CVI: CVI_AppExitCVI