LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FileSelectPopup

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;
}

0 Kudos
Message 1 of 12
(5,553 Views)

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.

Message Edited by ebalci on 03-01-2010 07:52 PM
S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 12
(5,543 Views)

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 Smiley Wink )

Message Edited by Roberto Bozzolo on 01-03-2010 06:51 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 12
(5,542 Views)
so is there a function i can save anything file at anytime with any extension ?
0 Kudos
Message 4 of 12
(5,527 Views)

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.

 

 

0 Kudos
Message 5 of 12
(5,525 Views)

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.

S. Eren BALCI
IMESTEK
0 Kudos
Message 6 of 12
(5,516 Views)

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? 

0 Kudos
Message 7 of 12
(5,490 Views)

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.

Message Edited by ebalci on 04-01-2010 10:20 PM
S. Eren BALCI
IMESTEK
0 Kudos
Message 8 of 12
(5,483 Views)
so those these 2 calling conventions are only use when dealing with dlls
0 Kudos
Message 9 of 12
(5,463 Views)
im going create a forum on __stdcall and __cdecl
0 Kudos
Message 10 of 12
(5,462 Views)