Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Problem with LMDBrowseDlg in Windows 10

Hi,

I am using C++Builder in RAD Studio 10.1 Berlin Update 1 and LMD-Tools 2016.6.

In Windows 10, if I run the code below which loads "C:\\MyFolder\\" into the LMDBrowseDlg1->SelectedFolder.  Then when I run the dialog with LMDBrowseDlg1->Execute(), the initial folder in the dialog is not C:\MyFolder but incorrectly the Desktop.

In contrast, if I run this code in Windows 7, it works fine and the LMDBrowseDlg1 initially correctly goes to C:\MyFolder.

Furthermore, in older code compiled with BDS2006 and LMD-Tools 7.12, similar code ran fine in Windows 7 and Windows XP going correctly to C:\MyFolder, but had the same problem in Windows 10 of going incorrectly to the Desktop.

Could you please tell me what I am doing wrong.



TLMDBrowseDlg *LMDBrowseDlg1;

ChangeFolder_LMDBrowseDlg(void)
    {
    UnicodeString    usSelectedFolder;

    LMDBrowseDlg1->SelectedFolder = "C:\\MyFolder\\";    // SelectedFolder has "C:\\MyFolder\\"
    if( LMDBrowseDlg1->Execute() )
        {
        // LMDBrowseDlg1 will go to Desktop, and will return "C:\\Users\\Neil\\Desktop" in the LMDBrowseDlg1->SelectedFolder
        usSelectedFolder = LMDBrowseDlg1->SelectedFolder;    // usSelectedFolder has "C:\\Users\\Neil\\Desktop"
        }
    }

Comments

  • 2 Comments sorted by Votes Date Added
  • Hi,

    I fixed this bug. It was not a bug in the LMDBrowseDlg but the way Windows 10 allocates a static LMDBrowseDlg that differs from Windows 7 and XP.

    I solved this problem by dynamically allocating the LMDBrowseDlg just before it was needed, and then deleted it just after it was exited.

    Sorry for the unnecessary question.

    Bill Anderson
  • Hi,

    I just tested the issue with placing the component on the form and executing the following code in the button click event:

    LMDBrowseDlg1.SelectedFolder := 'c:\1';
    LMDBrowseDlg1.Execute;

    And, dialog worked fine. Event if I execute it several times, and selected different foldefs each time, its start with required folder at subsequent execution. So, I can't reproduce your problem.
Sign In or Register to comment.