When I use TOpenDialog, after closing the program, there is an exception in the Vcl.Forms module.
Program I'm using:
std::auto_ptr<TOpenDialog> OpenDialog (new TOpenDialog(this));
if ( OpenDialog->Execute() ){}
Exception: 'access violation at 0x008133a4: read of address 0x000000c4'
Highlighted is line: if not FHandleCreated then
function TApplication.GetDialogHandle: HWND;
begin
if not FHandleCreated then
Result := SendMessage(Handle, CM_DIALOGHANDLE, 1, 0)
else
Result := FDialogHandle;
end;
I confirm this issue. I have project that uses TOpenDialog component. There was no problem with RAD C++ Builder 10.2 (Tokyo). But now I get same error after upgrading to RAD C++ Builder 10.4 Update 2 (Sydney). I don't use dynamic creation TOpenDialog with auto_ptr. Instead, I just dragged component on my form. So code is very simple:
It's enough to open this dialog, do nothing, press cancel and then close app. After that I got the same access violation like Jacek had. So problem is in C++ Builder 10.4
UPDATE: The problem is not in C++ Builder 10.4 itself. The error raises when application uses Custom Styles (Themes). I just disabled Custom Styles in my app and there is no error with OpenDialog.