src/win32: Add support for COINIT_APARTMENTTHREADED
This commit is contained in:
		 Shen-Ta Hsieh
					Shen-Ta Hsieh
				
			
				
					committed by
					
						 Max Kellermann
						Max Kellermann
					
				
			
			
				
	
			
			
			 Max Kellermann
						Max Kellermann
					
				
			
						parent
						
							22b840c2f1
						
					
				
				
					commit
					0cccdcf9b2
				
			| @@ -31,7 +31,17 @@ public: | ||||
| 	COM() { | ||||
| 		if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); | ||||
| 		    FAILED(result)) { | ||||
| 			throw FormatHResultError(result, "Unable to initialize COM"); | ||||
| 			throw FormatHResultError( | ||||
| 				result, | ||||
| 				"Unable to initialize COM with COINIT_MULTITHREADED"); | ||||
| 		} | ||||
| 	} | ||||
| 	COM(bool) { | ||||
| 		if (HRESULT result = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); | ||||
| 		    FAILED(result)) { | ||||
| 			throw FormatHResultError( | ||||
| 				result, | ||||
| 				"Unable to initialize COM with COINIT_APARTMENTTHREADED"); | ||||
| 		} | ||||
| 	} | ||||
| 	~COM() noexcept { CoUninitialize(); } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user