i've been trying to modify some code that there's been generated in this program
-------------------------------------------------------------------------------------------------------------------------
static void getRecommendedReportName(char reportFileName[], char reportPath[],
char reportPathName[]) {
char selectedStudyFile[MAX_PATHNAME_LEN];
char driveName[MAX_PATHNAME_LEN];
char dirName[MAX_PATHNAME_LEN];
char fileName[MAX_PATHNAME_LEN];
char temp[MAX_PATHNAME_LEN];
/* this gets us the complete path and name to the selected study file */
// (void) GetCtrlVal (panelHdl, PNL_REPORT_STR_STUDY_FILE_PATH,
// selectedStudyFile);
--------------->//i've commented this because it gave an error...the machine generated code said the PNL_REPORT_etc etc is an undeclared //Identifier...it's something that's generated in a machine code .h file..i have a feeling this might be causing the error in reading the input file name. SplitPath (selectedStudyFile, driveName, dirName, fileName);
/* extract just the name without extension */
(void) Scan(fileName, "%s>%s[t46xq]", temp);
/* add REPORT_FILE_SUFFIX to it to generate the suggested name */
(void) Fmt(reportFileName, "%s[qw*]<%s%s", MAX_PATHNAME_LEN -1, temp,
REPORT_FILE_SUFFIX);
/* construct the complete path to the selected report dir */
(void) Fmt(reportPath, "%s[qw*]<%s%s", MAX_PATHNAME_LEN -1, driveName,
dirName);
/* the complete path name of the recommended report file */
(void) Fmt(reportPathName, "%s[qw*]<%s%s", MAX_PATHNAME_LEN -1,reportPath,
reportFileName);
return;
}
is there basically a simpler way to get the filename,the path and plug it into this part of the code
------------------------------------------------------------------------------------------------------------SUPPRESS(715) /* Standard CVI Callback method signature */
SUPPRESS(818) /* Standard CVI Callback method signature */
int CVICALLBACK cmdSelectReportCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int statusCode = AMI_ERROR;
char selectedFile[MAX_PATHNAME_LEN];
char reportPathName[MAX_PATHNAME_LEN];
char reportFileName[MAX_PATHNAME_LEN];
char reportPath[MAX_PATHNAME_LEN]=REPORT_PATH;
switch (event) {
case EVENT_COMMIT:
getRecommendedReportName(reportFileName, reportPath, reportPathName);
//statusCode = FileSelectPopup (reportPath, reportFileName,
// STUDY_FILENAME_EXT, "Select Report File", VAL_SAVE_BUTTON,
// FALSE, FALSE, TRUE, FALSE, selectedFile);
statusCode = FileSelectPopup (reportPath, reportFileName,
STUDY_FILENAME_EXT1, "Select Report File", VAL_SAVE_BUTTON,
FALSE, FALSE, TRUE, FALSE, selectedFile);
if (statusCode != VAL_NO_FILE_SELECTED) {
(void) SetCtrlVal (panelHdl, PNL_REPORT_STR_REPOR_FILE_PATH,
selectedFile);
}
break;
default:
break;
}
return 0;
}
--------------------------------------------------------------------------------------------------------------------
i'd like you to kindly send me an email regarding this...my email is abhayvnadkarni@yahoo.com
thanks a lot roberto