Lazarus
Programming => LCL => Topic started by: CCRDude on April 16, 2021, 01:23:29 pm
-
I've got a project I compiled last year, Lazarus 2.1.0 rc62299, FPC 3.3.
Today I compiled, then updated laz/fpc trunk, now Lazarus 2.1.0 rc56006, FPC 3.3.1.
I use file dialogs in some places. TFileOpen action type, but sometimes directly, e.g. TSelectDirectoryDialog.
These dialogs have in common that in rc62299 they worked as expected, and in the past weeks, the process simply freezes instead of opening the requested system dialog.
-
Is this inside the debugger, or outside?
Bart
-
Both actually.
It simply freezes.
And I found the problem: I do use CoInitializeEx(nil, COINIT_MULTITHREADED)
. Switching to COINIT_APARTMENTTHREADED
, dialogs work.
Previously, I think both worked. Anyway, with standard LCL controls, I didn't expect conflicts with my COM stuff.
-
IFileDialog is a COM object.
-
Thanks, that explains it!
Wouldn't it make sense to print a compiler warning about calls to CoInitializeEx with the wrong parameter if the LCL is included in the projects requirements?
-
Thanks, that explains it!
Wouldn't it make sense to print a compiler warning about calls to CoInitializeEx with the wrong parameter if the LCL is included in the projects requirements?
I don't think so. Moreover, the compiler doesn't know what the LCL is.