LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

File browse control function panel

How to create a file browse control on function panel? Data type for file path is char*. By dropping a input it does not provide with the browse button.

Thanks

0 Kudos
Message 1 of 5
(3,000 Views)

Hi sonotk,

 

You can create a command button and have its callback function call the FileSelectPopup function.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,944 Views)

This help topic describes how to add the ... button on the function panel and associate a callback to it.

You could start from the example from samples\functionpanels\Customization\SelectColor.cws and write a function like this:

 

int DLLEXPORT CVICALLBACK SlectPath (FPCustomInfo *info)
{
    char path[MAX_PATHNAME_LEN];
    int parameter;
    
    FPCustom_GetSelectedParameter (info, &parameter);
    FileSelectPopupEx ("", "*.*", "", "select file", VAL_OK_BUTTON, 0, 0, path);
    /* additional processing to convert path into a string literal - enclose in quotes and
    replace special characters like '\' into escape sequences */
    FPCustom_SetParamValue (info, parameter, path);

    return 0;
}

Message 3 of 5
(2,910 Views)

Thanks for the response. Looked at the help topic it requires a DLL to customize the function panel. I do not have DLL, its an exe. Any sugestion as to what can be selected for dll, or are the funciton panel customized only when using DLL.

0 Kudos
Message 4 of 5
(2,865 Views)

You have to create a dll which exports the function you use in the callback. This dll is only for use in the function panel, it is independent from any other program you are developing.

0 Kudos
Message 5 of 5
(2,855 Views)