唐先生:
您好,我用PhAB编了一个程序,调用一个函数,在编译时总是出错,特向您请教。程序代码如下:
int
wmclose( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
PhWindowEvent_t *we=cbinfo->cbdata;
char *btns[]={"&Yes", “&No”, “&Save”};
char Helvetica14[MAX_FONT_TAG];
int filesel(PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t cbinfo);
/ eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
if(we->event_f==Ph_WM_CLOSE)
{
switch(PtAlert(ABW_base,NULL,NULL,NULL,
“Do you really want to exit”,
PfGenerateFontName(“Helvetica”,0,14,Helvetica14),
3,btns,NULL,1,2,Pt_MODAL)){
case 1:
PtExit(EXIT_SUCCESS);
break;
case 2:
return (Pt_CONTINUE);
case 3:
filesel();调用函数,参数是什么
break;
}
}
return( Pt_CONTINUE );
}
int
filesel( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
PtFileSelectionInfo_t info;
PtArg_t args[1];
int k;
/* Initialize the widget library and connect to Photon. */
PtInit( NULL );
/* Initialize the file-select info structure */
memset( &info, 0x0, sizeof(PtFileSelectionInfo_t) );
/* Change the name-column label of the PtFileSel widget
in the filesel dialog from the default “Name” to “Nom” */
PtSetArg( args, Pt_ARG_FS_LBL_NAME, “Nom:”, 0 );
info.args = args;
info.num_args = 1;
/* Invoke the convenience function. /
k = PtFileSelection( NULL, / parent /
NULL, / pos /
“PtFileSelection Example”, / title /
“~”, / root_dir, tilde is the home directory
specified by $HOME /
NULL, / file_spec filter /
NULL, / label of btn1, the Open button,
default is “Open” /
NULL, / label of btn2, the Cancel button,
default is “Cancel” /
NULL, / Pt_ARG_FS_FORMAT resource of the
PtFileSel widget, default is “nsd” /
&info, / PtFileSelectionInfo_t *info
structure, must be specified /
Pt_FSR_CONFIRM_EXISTING |
Pt_FSR_SHOW_HIDDEN |
Pt_FSR_NO_FCHECK / PtFileSelection flags */
);
if ( k ) {
fprintf( stderr, “\nPtFileSelection failed.” );
PtExit( -1 );
}
if ( info.ret == Pt_FSDIALOG_BTN1 )
fprintf( stderr,
“\nOpen button was pressed. The selected file is:\n\t%s\n”,
info.path );
else
fprintf( stderr, “\nCancel button was pressed.\n” );
return ( Pt_CONTINUE );
}
不知道怎样传递参数