Browse Source

Fix for mingw. Assertion to catch use of win32 COM on an uninitialised thread.

tags/2021-05-28
jules 13 years ago
parent
commit
e184bec3d3
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      modules/juce_core/native/juce_win32_ComSmartPtr.h

+ 4
- 2
modules/juce_core/native/juce_win32_ComSmartPtr.h View File

@@ -63,7 +63,9 @@ public:
HRESULT CoCreateInstance (REFCLSID classUUID, DWORD dwClsContext = CLSCTX_INPROC_SERVER)
{
return ::CoCreateInstance (classUUID, 0, dwClsContext, __uuidof (ComClass), (void**) resetAndGetPointerAddress());
HRESULT hr = ::CoCreateInstance (classUUID, 0, dwClsContext, __uuidof (ComClass), (void**) resetAndGetPointerAddress());
jassert (hr != CO_E_NOTINITIALIZED); // You haven't called CoInitialize for the current thread!
return hr;
}
template <class OtherComClass>
@@ -134,7 +136,7 @@ public:
JUCE_COMRESULT QueryInterface (REFIID refId, void** result)
{
if (refId == __uuidof (ComClass))
return castToType <ComClass> (result);
return this->castToType <ComClass> (result);
return ComBaseClassHelperBase <ComClass>::QueryInterface (refId, result);
}


Loading…
Cancel
Save