createLink fail


#1

I want to use File::createLink but it fails on assert

    HRESULT CoCreateInstance (REFCLSID classUUID, DWORD dwClsContext = CLSCTX_INPROC_SERVER)
    {
        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;
    }

I think it's better to add

CoInitialize(NULL); 

at the beginning of the bool File::createLink (const String& description, const File& linkFileToCreate) const


#2

Hmm. I don't like the idea of making it call CoInitialize every time the function gets called, but since a common use-case for this would be to call it on a background thread, I reckon you're probably right, unfortunately.