|
-
Aug 29th, 2018, 07:25 PM
#1
Thread Starter
New Member
Open file dialog appearance problem in Windows 10
I have noticed an odd problem with the standard open file dialog box in Windows 10. The dialog box works okay but the top bar displaying the current path shows a ? as the first character for each folder and eliminates two characters off the end of the folder name.
For example, what should appear as "inetpub wwwroot"
shows as "?inetp... ?wwwro..."
This problem only appears on Windows 10. It looks fine on Window 7. I believe I have the latest common control installed. My VBP file includes
#2.2#0; MSCOMCTL.OCX
Has anyone seen this before or have any suggestions?
Thank you.
-
Aug 30th, 2018, 05:32 AM
#2
Re: Open file dialog appearance problem in Windows 10
From all the issues like this that pop up here, it seems MS just doesn't look too carefully for bugs that effect ancient things like VB6 and MSCOMCTL. That's not something that will be readily fixable unless it's a Unicode issue and you could rename the folder (which admittedly seems possible).
You could try the GetOpenFileName API instead, but really unless you need to maintain XP support you should be using IFileOpenDialog (alt using DispCallFunc instead of TLB here).
-
Aug 31st, 2018, 06:40 PM
#3
Thread Starter
New Member
Re: Open file dialog appearance problem in Windows 10
Thank you very much for the suggestion.
I'm trying to work with LaVolpe's solution. Unfortunately, I've run into a limit. I don't see how to offer three choices in the Save As version when a file already exists. The class as it is offers a warning and offers erase or not choices, but not a merge/add to choice, the way Word does.
When using the old OCX, I could get the file name while the dialogue was still shown and display my own message and either close the pop-up with or without closing the dialogue as needed. I don't see where I can get the file name while the dialogue is still shown.
I put in a post this afternoon asking the author about that.
Thanks again for your suggestion.
-
Sep 1st, 2018, 12:57 AM
#4
Re: Open file dialog appearance problem in Windows 10
In the event sink there's an OnSelectionChange event, it passes a reference to the IFileDialog which you can then use .GetFileName. In LaVolpe's this is passed to the DialogOnSelectionChanged event.
Merge and add counds like a custom Word feature, not something that's in a standard save dialog (or it'd be in most apps)... did the OCX offer such an option?
If you wanted to display a message when OK was clicked but not close the dialog, you'd respond to the OnFileOK event and in LaVolpe's version set the Cancel flag to then not close the dialog. If you really needed a MsgBox after the dialog is shown instead of right beforehand, there's the DialogOnInit event in Lavolpe's (which is triggered by using the fact a typechange message always fires when it loads).
If these messages are just basic information, don't forget you can just add a label.
Last edited by fafalone; Sep 1st, 2018 at 01:15 AM.
-
Sep 1st, 2018, 11:41 AM
#5
Re: Open file dialog appearance problem in Windows 10
Common Dialog, not Common Control. COMDLG32.OCX, not MSCOMCTL.OCX.
In any case it seems to work fine for me on Windows 10 1803. The older Common Dialogs still work just fine. Most programs do not need the bells and whistles of the newer ones.
Is there anything unusual about your Windows 10 installation, perhaps locale related? I'm thinking of the part in regional and language settings about the language setting for non-Unicode programs.
Last edited by dilettante; Sep 1st, 2018 at 11:46 AM.
-
Sep 1st, 2018, 01:32 PM
#6
Thread Starter
New Member
Re: Open file dialog appearance problem in Windows 10
Thanks for your suggestions.
Yes, it is probably a custom feature in Word. I have the same need - to let users add a new document to an existing one.
I see the DialogOnSelectionChanged event in the cls, but do not know how to use it in the middle of the ShowSave function. I have never needed to do that before.
I see that
lReturn = pvCallInterface(ObjPtr(m_Dialog), ifModalWindow_Show, ownerHwnd)
is the place in the function that actually displays the dialog, but it seems to show the standard replace or not popup when an existing file is selected. I need to suppress that and replace it with the 3 alternative version. Perhaps the event will let me do that, but I don't know how.
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|