Page 2 of 2 FirstFirst 12
Results 41 to 55 of 55

Thread: [vb6]Common Dialog Class (Yet Another One)

  1. #41
    Junior Member
    Join Date
    Sep 2017
    Posts
    17

    Re: [vb6]Common Dialog Class (Yet Another One)

    I'm trying to answer, but by the time I finish the answer it shows me logged out and all my writing is gone....
    I can show you everything and discuss it seriously if you skype me.
    How can I write you my contact not public?
    Thanks.

  2. #42

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [vb6]Common Dialog Class (Yet Another One)

    Quote Originally Posted by DerWeise View Post
    How can I write you my contact not public?
    Thanks.
    Click on a user's handle/user name in left side of posting and choose to send a PM (private message).
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #43
    Fanatic Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    760

    Re: [vb6]Common Dialog Class (Yet Another One)

    Hi LaVolpe - I used the old version of this class from the thread:

    http://www.vbforums.com/showthread.p...-%28No-TLBs%29

    But I just found an issue today. When I navigate to Win\Sys32 in my app, I see the contents of Win\SysWOW64. I'm aware that this is due to file system redirection. So I used the same code I use elsewhere in my app to disable FS redirection before using the class but it doesn't fix the problem. I still see SysWow64 contents. Is this a bug you're aware of? Is this resolved in the new one? Before I replace the old one with a new one I'd like to know.

    Thanks!

  4. #44
    Hyperactive Member
    Join Date
    Aug 2017
    Posts
    380

    Re: [vb6]Common Dialog Class (Yet Another One)

    Quote Originally Posted by AAraya View Post
    Is this resolved in the new one?
    I don't know if LaVolpe already has a fix for this but I found a possible solution here. The attached zip file below contains a VB6 port of the C++ code from that link plus a demo. If you don't find that solution satisfactory, you might want to investigate this alternative approach: IFileDialogEvents::OnFolderChanging + IFileDialog::SetFolder + SysNative.

  5. #45
    New Member
    Join Date
    Nov 2019
    Posts
    2

    Re: [vb6]Common Dialog Class (Yet Another One)

    Code:
    ' basket mode. select files across various folders. there are 5 basket mode options
     cBrowser.Controls_SetCustomMode cm_BasketModeFoldersOnly
    cm_BaketModeFoldersOnly isn't working, dialog show only folder but can't add any folder. I use cm_BasketModeFilesOrFolders instead

  6. #46
    New Member
    Join Date
    Aug 2018
    Posts
    7

    Re: [vb6]Common Dialog Class (Yet Another One)

    Hi. I have a case in which ShowOpen does not return a proper filename. I'm selecting a file with the following name: "Πασχαλινή ιστορία.pdf". This is loaded and shown (in the example) as "Πασχαλινη? ιστορι?α.pdf". It actually removes the accent from the two letters that have it and places a ? after the letter. Any ideas why this is happening and how to correct it?

  7. #47
    New Member
    Join Date
    Aug 2018
    Posts
    7

    Re: [vb6]Common Dialog Class (Yet Another One)

    Forgot to say, i'm using a fully updated Win10 to test it but i also tried it under XP and the same thing happens.

  8. #48
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,736

    Re: [vb6]Common Dialog Class (Yet Another One)

    Is it shown with the mangled file name in the CommonDialog list?
    Or when you use the filename on a different place?

  9. #49
    New Member
    Join Date
    Aug 2018
    Posts
    7

    Re: [vb6]Common Dialog Class (Yet Another One)

    If at the end of Form1.pvDoSamples, you add this:
    Code:
    MsgBox cBrowser.Filter
    you get an "invalid procedure call or argument" error.

    Suggested corrections for this, in class CmnDialogEx:

    Code:
    Public Property Get Filter() As String
        If Len(ofn.lpstrFilter) Then
            Dim Flt As String
            Flt = ofn.lpstrFilter
            If ofn.lpstrFilter <> vbNullChar Then
                Flt = Replace$(Flt, vbNullChar & vbNullChar, "|") 'This line exists because at the definition of structure OPENFILENAME, for field lpstrFilter there is a comment saying "ends with 2xvbnullchar". This seems to have been set that way in Let Filter.
                Flt = Replace$(Flt, vbNullChar, "|")
            End If
            Filter = Flt
        End If
    End Property

  10. #50
    New Member
    Join Date
    Aug 2018
    Posts
    7

    Re: [vb6]Common Dialog Class (Yet Another One)

    Quote Originally Posted by Arnoutdv View Post
    Is it shown with the mangled file name in the CommonDialog list?
    Or when you use the filename on a different place?
    It is shown that way:
    1. When i use the standard CommonDialog control
    2. When i use this library, in the results Textbox (sorry, strike that, i meant Listbox)
    3. When i debug the code and place a Watch in the FileName property


    Under both Windows 10 and XP.
    Last edited by VB.6; Oct 27th, 2023 at 05:06 AM.

  11. #51
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,736

    Re: [vb6]Common Dialog Class (Yet Another One)

    I tested your sample filename with the class provided in this thread (based on IFileDialog) and it's shows the correct filename.
    The VB6 IDE is not Unicode, so when using Watch and Debug.Print will give mangled results.
    Also the default control set is not capable of showing Unicode text.
    Use this control set as an alternative:
    https://www.vbforums.com/showthread....mmon-controls)

  12. #52
    New Member
    Join Date
    Aug 2018
    Posts
    7

    Re: [vb6]Common Dialog Class (Yet Another One)

    Well, thanks for all of these but as it turns out, the name of the file i was trying to use has some kind of problem (i'm guessing the accented letters may be in a different codepage)! I renamed it, typed the exact same name and everything was fixed! Strange...

    PS: BTW, i love your avatar!

  13. #53
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    536

    Re: [vb6]Common Dialog Class (Yet Another One)

    ShowSave problem

    I use the dialog for years now, but only for Open.
    Now I need the Save functionality.
    Works as expected, but the filename extension dos not get added to the entered filename.

    Here's what I do.
    In the app, the dialog comes up, and I enter the filename, e.g. "MyFile".
    I'd expect .FileName would deliver "MyFile.fxy".
    But I only get "MyFile".

    Code:
    With cBrowser
    	.FileName = FileName
    	.Filter = "MyFiles" & "(*.fxy)|*.fxy|"
    	.FilterIndex = 0
    	.InitDir = "C:"
    	.DialogTitle = "Title"
    End With
    
    bReturn = cBrowser.ShowSave(Owner.hwnd, eEvents)
    If bReturn Then TheFile = cBrowser.FileName
    This is different to other common dialog 'systems'.
    What could I do, except adding the extension by code?

  14. #54
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,736

    Re: [vb6]Common Dialog Class (Yet Another One)

    Have you checked for properties like: DefaultExt / DefaultExtension / propDefaultExtension

  15. #55
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    536

    Re: [vb6]Common Dialog Class (Yet Another One)

    Quote Originally Posted by Arnoutdv View Post
    Have you checked for properties like: DefaultExt
    That's what I missed.
    Thank you!

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width