I've checked on several previous posts and the code they supplied to browse for folders but too many things have changed with IVF. In my 2016 Composer XE I don't have a file called extrawinty.f90 nor many other things. Some of the solutions lead you to a website that VIPRE says is very bad and the file no longer exists there. So, does anyone have a code segment and how to use it? This is the last section of code for my project.
I've looked at that example and I use it in my project; however, I did find
GetSaveFileName which will serve my purpose.
PS, missed you the last few days.
Has anyone got the newer IfileDialog Interface working in Fortran, I had a quick look at it a couple of year ago and I recall a number of other forum members have looked at it and run away......
I will point out that, although deprecated, SHBrowseForFolder() works fine in Windows 10.
INTEGER :: pidl CALL COMInitialize (status) buffer = folderPath ! TYPE T_BROWSEINFO ! SEQUENCE ! INTEGER :: hwndOwner ! INTEGER :: pidlRoot ! INTEGER :: pszDisplayName ! INTEGER :: lpszTitle ! INTEGER :: ulFlags ! INTEGER :: lpfn ! INTEGER :: lParam ! INTEGER :: iImage ! END TYPE T_BROWSEINFO bi%hwndOwner = hwndParent bi%pidlRoot = NULL bi%pszDisplayName = LOC(buffer) bi%lpszTitle = LOC(titleBuffer) bi%ulFlags = BIF_RETURNONLYFSDIRS bi%lpfn = NULL bi%lParam = 0 bi%iImage = 0 ! SHBrowseForFolder returns an item identifier list. pidl = SHBrowseForFolder (bi) IF (pidl /= 0) THEN SELECT CASE (windows_version) ! Win95 and Win98 CASE (VER_PLATFORM_WIN32_WINDOWS) ! We need to ask the shell to decode the item identifier ! list into a parseable name. First, retrieve an IShellFolder ! COM interface handle to the desktop folder. rval2 = SHGetDesktopFolder(LOC(IShellFolder_desktop)) IF (rval2 == NOERROR) THEN ! Use the GetDisplayNameOf method to convert the item ! identifier list into a string. The SHGDN_FORPARSING flag ! indicates we want the parseable path, not the general- ! purpose display label. rstring%uType = STRRET_CSTR rval2 = IShellFolder_GetDisplayNameOf (IShellFolder_desktop, pidl, SHGDN_FORPARSING, LOC(rstring) IF (rval2 == NOERROR) THEN folderPath = rstring%cStr CmnDlgChooseFolder = .TRUE. END IF END IF ! WinNT, Win2K, WinXP CASE DEFAULT !(VER_PLATFORM_WIN32_NT) CmnDlgChooseFolder = SHGetPathFromIDList (pidl, folderPath) END SELECT CALL CoTaskMemFree (pidl) END IF CALL COMUnInitialize ()
Thanks for commenting Paul. I know the older (deprecated) file API's work OK in W10 and are unlikely to stop working any time soon. I was interested if anyone has implemented the newer (not deprecated) IFileDialog API's?