I'm kind of stuck trying to add a combobox to a TFileDialog (in this case a TOpenDialog). I tried to adapt an old Delphi example I found on StackOverflow to Lazarus.
Everythings seems fine, but i get an "Error: identifier idents no member "QueryInferace" while compiling on lines 57 and 68
QueryInterface() is
protected in
TComponent, in both Delphi and FreePascal. So, you can't call it directly from outside of the class. However,
TComponent inherits a
public GetInterface() method from
TObject, and
TComponent.QueryInterface() uses
TObject.GetInterface() internally.
However, you should use
SysUtils.Supports() instead. Even in Delphi, this is the preferred way to query objects for interfaces.
However,
TOpenDialog itself does not implement
IFileDialogCustomize, so I would expect any of these query methods to fail. It is the
IFileDialog object that is wrapped inside of the
TOpenDialog which implements
IFileDialogCustomize. So, you would need to query that
IFileDialog object instead.
But, I don't think
TOpenDialog in FreePascal/Lazarus exposes access to the wrapped
IFileDialog.
TOpenDialog in Delphi certainly doesn't. Delphi has a whole separate
TFileOpenDialog component which does expose access to
IFileDialog, but FreePascal/Lazarus does not have that component.
I don't know which StackOverflow example you based your code on, but I don't see how it could ever have worked in Delphi, let alone in FreePascal/Lazarus.