In an application I am opening different files residing in different folders. To perform the assignment, I try to force Windows to display the correct folder. in the way that if I want to open an .INP file, the FileOpen dialog should list the content of the INP directory aso. However, the FileOpen dialog box lists the file content of the most recent directory. In the example below, the files in the "InputDir" should be listed and this happens. But next, when I will open a PLT file (not shown here), the dialog box list the files in the InputDir, and vice versa...
What could be done to fix the problem ?
! get open file dialog box
Ofn%Flags = null
szfilter = &
"TVC input files(*.INP)"C//"*.INP"C// &
"Simulation input files(*.SIN)"C//"*.SIN"C//""C
Ofn%LPSTRINITIALDIR = loc(trim(InputDir)//Char(0))
iret = CHDIR(InputDir)
iret = InitializeOpen()
bret = GETOPENFILENAME(Ofn)
bret=.true.
! check to see if the OK button has been pressed
if(bret == 0) then ! check for error
call COMDLGER(ierror)