soccer jersey forums.silverfrost.com :: View topic - Browse_for_folder1@ is failing to create a user-named folder
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Browse_for_folder1@ is failing to create a user-named folder
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Fri Jan 18, 2019 5:54 pm    Post subject: Browse_for_folder1@ is failing to create a user-named folder Reply with quote

The following code segment asks for the user to choose or create a folder. Choosing an existing folder works fine, but creating a folder with a new non-default name does the following when you click OK :

The folder is created with the name you typed in
The program quits with no error/crash indication

If you just want a new folder created (default name), it works fine.

I'm not sure when this stopped working properly.

Running V8.40.0.

Code:
   winapp
   PROGRAM MAIN
    use mswin
   character*260:: returned_path=' '
    integer:: uint=z'41'
    integer(7):: window_handle=0
    if(browse_for_folder1@(window_handle,'Caption',returned_path,uint)) then
      print *,'Returned:',trim(returned_path)
    else
      print *,'Cancelled'
    endif
    end
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Fri Jan 18, 2019 6:05 pm    Post subject: Reply with quote

It also doesn't work in programs compiled in June of last year with 8.30.0.
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Fri Jan 18, 2019 7:07 pm    Post subject: Reply with quote

This was extracted from the MSDN site. Is it applicable?

Note If COM is initialized using CoInitializeEx with the COINIT_MULTITHREADED flag, SHBrowseForFolder fails if the calling application uses the BIF_USENEWUI or BIF_NEWDIALOGSTYLE flag in the BROWSEINFO structure.

https://docs.microsoft.com/en-us/windows/desktop/api/shlobj_core/nf-shlobj_core-shbrowseforfoldera
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Sat Jan 19, 2019 12:18 am    Post subject: Reply with quote

Looking back at some of my posts, it occurred to me that I have had something like this problem before.

And, looks like I still have. It is not a problem with FTN95 or the libraries.

Running the software on a different platform. It would appear that it works just fine.

So it is unfortunate, but my development system has some kind of problem.

If anyone has any insight into what I should look at/fix, I'm open for suggestions. I tried a LOT of different things (a couple of years ago), but nothing seemed to work.

Thoughts?
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Mon Jan 21, 2019 6:05 am    Post subject: Reply with quote

Some more information.

Running as Admin, works fine. Running as a user (different account), it kinda works. Kinda meaning that when I change the folder name, it gets changed, but reports the original folder name (i.e. New Folder) to the program. Like there is something delaying the setting of the proper name to the program. But, oddly, actually changing the name on disk!

I tried Clean Boot, and that didn't help at all.

Development computer is Windows 10 Pro 64-bit (upgraded from Windows 7 Pro), 32 GB ram, i&-3820 @ 3.6GHz. Nvidia GT-660 graphics card.

Running 8.40.0. Similar problem with 8.30.0 in the real application.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8011
Location: Salford, UK

PostPosted: Mon Jan 21, 2019 8:30 am    Post subject: Reply with quote

It seems likely that this is a Microsoft issue where, for this particular operating system, the new folder requires elevated access privileges.

I can't see a way to get at a Microsoft error code for the failure which in any case would probably be "Access denied".

At the moment the routine calls upon SHBrowseForFolder. At some point this could be reworked in order to use IFileDialog instead but this may not make any difference to the outcome.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2393
Location: Yateley, Hants, UK

PostPosted: Mon Jan 21, 2019 11:06 am    Post subject: Reply with quote

IT support can often make settings in your computer that stop things working. I have an app that worked fine on all manner of computers. IT reconfigured the (very easy to steal) laptops (which replaced big boxes that no-one wanted) it ran on during a field course some 60 miles from base to check if they were on a LAN in the building where the techie worked, and if not, they would shut down*. After working out what the problem was, and several shouted phone calls, the fat techie came down to site, reconfigured all the machines and set the default directories used by the app to �read only�. Fortunately, there was always the USB stick.

IT support is thus staffed by people whose sole interest is to � well you may get my meaning, but nose picking, porn watching, games playing and scratching unmentionable areas leap to mind - pick which one fits).

Things aren�t any better if you do your own IT support !!!**

Eddie

*At that point, I realised that files needed to be saved on �Exit Windows�, and why format code %ew is important!

** Some of my own issues disappeared after a clean re-install. If you create a Windows 10 install CD by downloading the appropriate ISO from MS, you can install Win 10 afresh onto a clean boot device. This is a good moment to fit an SSD if you haven't already. Voila! Many issues simply disappear,

And before you ask, I do my own IT support, and my vice is pulling my hair out while cursing at the screen!
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Mon Jan 21, 2019 3:41 pm    Post subject: Reply with quote

Paul, I agree that this is a Microsoft (and ME!) issue. From the lack of other user responses, it would appear that it is just me! And, none of my users have complained either, so it is isolated.

Using the IFileDialog might work. The file dialog does not have the problem of creating a folder and renaming it. I have limited experience in using system functions, but have done a couple, and will pursue this as an alternative. There are limited examples for this specific functionality on line.

One question: I do use the "alt_open_save" option. I discovered that I needed to use this for regular file dialogs. It matters not if I use it for this problem. I wonder if that might be a clue.

My next recourse is to back up my entire user account, remove it, and rebuild it from scratch. The next step (drastic) is a fully clean install of Windows 10.

When all else fails, nuke and pave.
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2393
Location: Yateley, Hants, UK

PostPosted: Mon Jan 21, 2019 3:47 pm    Post subject: Reply with quote

Bill,

Several experiences have convinced me that the clean install is the answer to many Windows 'issues'. Be brave!

(And it's always useful to have a spare computer!)

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8011
Location: Salford, UK

PostPosted: Mon Jan 21, 2019 4:58 pm    Post subject: Reply with quote

Bill

For 64 bit code, at the moment browse_for_folder1@ does not make use of the user's setting for "alt_open_save".
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Tue Jan 22, 2019 3:03 am    Post subject: Reply with quote

It will be a while before I start another conversion process to 64-bit! Thanks for the heads up, though.
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2580
Location: Sydney

PostPosted: Tue Jan 22, 2019 3:20 am    Post subject: Re: Reply with quote

wahorger wrote:
It will be a while before I start another conversion process to 64-bit!


Bill,
I hope that is not an indication that you are reluctant to use /64.
All my coding is now 64-bit ( although I do use both 32-bit and 64-bit FTN95 for development testing in case they identify different problems )

John
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Tue Jan 22, 2019 6:08 am    Post subject: Reply with quote

John,

Not reluctant at all! I have done a great deal to make this version of my SW ready for 64-bit. I just happen to have numerous customers who are using older machines without 64-bit capability, so there's no hurry.

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1225
Location: Morrison, CO, USA

PostPosted: Wed Feb 06, 2019 5:19 am    Post subject: Reply with quote

Well, I bit the bullet and first tried to force a different User Profile (the easy solution?). That didn't full work, and left the system in an odd state. So, clean boot, reinstall everything.

This part was very interesting, as I hadn't really realized how many different tools I had on my system that made life easy for development and deployment. Many were obvious, but some were not, and when I needed them during my rebuild, I found I really missed them!

The good thing is now I can use the browse_for_folder1@() option z'41' without an issue. It all works as does my other system.

I just wish I knew what part of the system got "broken" and how I could have fixed it more easily.

N.B. I had to re-install every FTN95 compiler, starting at 7.10 to ensure I had the proper version with no Personal Edition splash screen. I'm hoping that the next release has a FULL moniker on it to prevent me from installing 9 versions of the compiler. Even though the install is quick, it's still a pain.
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2393
Location: Yateley, Hants, UK

PostPosted: Wed Feb 06, 2019 11:07 am    Post subject: Reply with quote

Bill,

I told you* (amidst a whole bunch of 'asides') that a clean install would fix it, and I very much regret that reinstalling so many other applications has wasted much time, but equally, I am glad for you that it worked. On the basis of several experiences I would estimate that the clean install takes about 3 days to get everything reinstalled afterwards.

Why Windows takes a dislike to one particular thing is a mystery only solvable by gaining a complete mastery of the Registry and its most arcane settings. That would take more than the odd 3 days now and then out of your life. A different User Profile simply inherits the bad genes from its parent, and is never a complete solution.

Eddie

*I don't mind the lack of effusive outpourings of gratitude, but if you can send the food parcels to us starving Brits, we'd be suitably grateful (apparently, after Brexit, shops will be empty). Unlike 80 years ago, there shouldn't be U-boat packs out there, but one never knows ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group