Use multithreaded instead of apartment-threaded Uses the multithreaded COM threading model in pdfium_test, instead of the apartment-threaded one. Correct usage of the apartment-threaded model requires a message pump, which console applications don't have. The XPS object model service supports both threading models equally, so the models are the same for us otherwise. Bug: pdfium:2059 Change-Id: If6ecfea6199dd2877f93bd824b3ff988972aac4d Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/109250 Commit-Queue: K. Moon <kmoon@chromium.org> Reviewed-by: Nigi <nigi@chromium.org>
diff --git a/samples/helpers/win32/com_factory.cc b/samples/helpers/win32/com_factory.cc index 7da80a7..7c5fe44 100644 --- a/samples/helpers/win32/com_factory.cc +++ b/samples/helpers/win32/com_factory.cc
@@ -25,8 +25,8 @@ bool ComFactory::Initialize() { if (!initialized_) { - HRESULT result = CoInitializeEx( - nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); + HRESULT result = + CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE); DCHECK_NE(RPC_E_CHANGED_MODE, result); initialized_ = SUCCEEDED(result); }