[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: File Select dialog wouldn't run



Here is some basic debugging technique - excuse me if you have already tried this.

I suggest running your app in the debugger and putting a breakpoint inside the case block. If it doesn't reach that breakpoint, then your button isn't triggering a btnBrowse event. If it does reach the case, then step through and examine the values. 

I usually have a debug build of V with a full symbol table available so I can follow my calls into the library if needed. In this case, you can follow the call to fsel.FileSelect to see if it constructs the dialog.

One note on your filter: Use a syntax like this:

  char* filter[] =
  {
   "Initialization|*.ini|"    // case 0
   "Parameters|*.nc|",   // case 1
   NULL
  };

Note the lack of commas after each line, except before the NULL. Also note the use of the "|" character to separate the text description and the filter specifier.

Another suggestion regarding your pathname variable: Both Unix and Win32 paths can be well over 200 chars in length. Give your path string at upwards of 300 chars of space.


----- Original Message ----- 
From: Alexander Gorshenin 
To: VGUI 
Sent: Tuesday, July 27, 1999 9:36 AM
Subject: File Select dialog wouldn't run


i wrote this routine to run FileSelct dialog from my modeless dialog. It compile well. But click on Browse button (corresponding to btnBrowse) leads it nowhere.

How could it be?
 
file://Case for Browse button
 case btnBrowse:
 {
   static char* filter[] = file://File filter
     {
       "*", file://All files
       "*.cfg", file://Configuration files
     };
   static int filterIndex = 0; //Filter index
   char pathname[50];  //File pathname
   vFileSelect fsel(this); //Instance os FileSelect Dialog

   int oans = fsel.FileSelect("Select configuration file",pathname,49,
   filter,filterIndex);
   break;
 }
 //End Case for Browse button 

Best regards, Alexander Gorshenin, MIPT


Reply to: