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  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: 568
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: 568
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: 568
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: 568
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
John-Silver



Joined: 30 Jul 2013
Posts: 1079
Location: Aerospace Valley

PostPosted: Mon Jan 21, 2019 3:15 am    Post subject: Reply with quote

Propably worth giving some info on your system (hardware & OS) Bill
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 568
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: 5835
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
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1969
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: 568
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: 1969
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: 5835
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
wahorger



Joined: 13 Oct 2014
Posts: 568
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: 2079
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: 568
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
John-Silver



Joined: 30 Jul 2013
Posts: 1079
Location: Aerospace Valley

PostPosted: Wed Jan 23, 2019 11:48 am    Post subject: Reply with quote

Eddie said ...
Quote:
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).


where I worked in Florence,Italy around midday one Monday I started to cross paths with lots of glum faces.
All was revealed in the early afternoon when a colleague told me that IT had shutdown (banned) access to .... the Fiorentina F.C. website !
Talk about hitting productivity !

Of course their over-zealous (?) IT's attempts to stifle foda-bone access to this important database fell into inconsequence when some time later the chinese managed to hack the company's site. It's still not known if they were attracted by the trafic to the La Viola information or not Wink.
Rumour has it that the IT department was dominated by people from Prato, a town some 15km to the west of Florence and who in the majority support ....... Juventus. (Google IT to find out more of this toscane animosity)

The talk of usb sticks reminds me of when I first startd using PC's in work environment, circa end of '93 when a student suddenly turned ìgreen at his machine. Hallf an hour later IT man appeared and removed a floppy from the machine. After confirming it contained a virus there ensued a hilarious scene of student and IT at each end of the floppy each pulling this way and that until the student gave way.
I'm surprised thaat any form of removeable drive is allowed anywhere near ANY work environment !
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
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  Next
Page 1 of 3

 
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