com.d: Add option for multithreaded COM

This commit is contained in:
Dennis 2024-06-17 13:26:12 +02:00 committed by GitHub
parent 601a231a02
commit 89c4efa135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

5
com.d
View File

@ -196,11 +196,12 @@ shared static ~this() {
}
///
void initializeClassicCom() {
void initializeClassicCom(bool multiThreaded = false) {
if(coInitializeCalled)
return;
ComCheck(CoInitialize(null), "COM initialization failed");
ComCheck(CoInitializeEx(null, multiThreaded ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED),
"COM initialization failed");
coInitializeCalled++;
}