Howdy, Stranger!

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

In this Discussion

Fix für LMDVistaDialogs, Setting of FileTypeIndex

Please change in

   TLMDCustomFileDialog.Execute

Block:

      if FFileTypes.Count > 0 then
      begin
        FDialog.SetFileTypeIndex(FFileTypeIndex);
        FFileTypes.AllocNativeBuffer;
        try
          FDialog.SetFileTypes(FFileTypes.Count, FFileTypes.FillNativeBuffer);
        finally
          FFileTypes.FreeNativeBuffer;
        end;
      end;

Move Line to  FDialog.SetFileTypeIndex to last of block.
It isn't possible to set FileTypeIndex if the file types are not set.


Comments

  • 4 Comments sorted by Votes Date Added
  • Can you describe for what it can be used (sets FileTypeIndex without file types) I move   FDialog.SetFileTypeIndex(FFileTypeIndex); above "if" block, but not sure that it can be reason of come side effects.
  • The Setting of FileTypeIndex works only if there are the FileTypes-Liste filled.

    Try to use TLMDFileSaveDialog with setting of FileTypeIndex <> 0 before opening.
    Then you will get in some circumstances duplicated extesions.

    e.g  MyFile.jpeg.png instead of MyFile.png.





  • edited April 2011 Posts: 0Vote Up0Vote Down
    I see. Ok - I re-wrote this code like this:
          FDialog.SetFileTypeIndex(FFileTypeIndex);
    if FFileTypes.Count > 0 then
    begin
    FFileTypes.AllocNativeBuffer;
    try
    FDialog.SetFileTypes(FFileTypes.Count, FFileTypes.FillNativeBuffer);
    finally
    FFileTypes.FreeNativeBuffer;
    end;
    end;
Sign In or Register to comment.