02-15-2013 12:49 PM
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
02-18-2013 01:00 PM
Hi sonotk,
You can create a command button and have its callback function call the FileSelectPopup function.
02-19-2013 05:53 AM
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, ¶meter);
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;
}
02-20-2013 02:30 PM
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.
02-21-2013 01:55 AM
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.