01-03-2010 07:01 AM
ok im having problems with this function, its not saving the file i want to save in the directory path im giving it.
once the browse box or directory box pop up i go to the directory and click save. once i go to the directory that i try to
save the current file its not there. and also im trying to save a keithtest.xls. its not working. do any one know why?
void Save_File(void)
{
const char* sTitle="Hi, My name is keith. testing function!";
char fn[500]="C:\\KeithTest";
int selection=0;
char dir[500]={0};
selection = FileSelectPopup (dir, "*.xls", "*.vid;", sTitle, VAL_SAVE_BUTTON, 0, 0, 1, 0, fn);
return SUCCESS;
}
01-03-2010 11:46 AM - edited 01-03-2010 11:52 AM
darnell,
You are expecting too much from the FileSelectPopup function.
This is just a popup for you to "select" an existing file. Nothing more...
It outputs the path of the file you selected for you to use in other functions like OpenFile, fopen, etc...
Selecting the button label as Save does not add the function a file save capability 😉
Read the online help carefully...
If you want to create/edit/save Excel files you need to use the excelreport library.
01-03-2010 11:50 AM - edited 01-03-2010 11:51 AM
FileSelectPopup is only a browsing command: it permits you to navigate among computer resources and returns a complete pathname of the file you have selected. It's up t you to handle that file in the proper way (either opening, deleting, saving or else).
The option for "Save" button is aimed to activate the built-in check for file existance: the system will prompt you for a confirmation in case the selected file already exists in the destination directory. If you use Open or Select button it will force you to select an existing file. That's all.
(Slower than ebalci, this time
)
01-03-2010 06:12 PM
01-03-2010 06:25 PM
excelreport library , I just also added the excelreport.fp as soon as i add the the file an error came up in the excel report.c file do you have an ideal why?
atexit(AtExitHandler);
99, 33 Type error in argument 1 to `atexit'; calling convention mismatch.
01-04-2010 12:16 AM
Hi darnell,
I reproduced your error when I changed the default calling convention to __stdcall.
So all you need to do is go to Options > Build Options menu and change the "Default calling convention" to __cdecl.
It is the second option from the top, on the left side.
01-04-2010 01:45 PM
not to get off topic. __stdcall
what is the __stdcall use for
and also __decl
if i can remember I know they are normally use when importing and exporting dll.
can you point me in the right direction?
01-04-2010 02:16 PM - edited 01-04-2010 02:20 PM
Somehow, I knew that you were gonna ask this question. So I had my answer ready.
However, I decided not to spend time on writing it since there are readily available good information about it on the Web.
A quick search for the term "calling convention" in the CVI help and Google will point you to the right direction.
I also did it myself to refresh my mind.
01-04-2010 10:00 PM
01-04-2010 10:13 PM