From fb3b5035aaffc93d5472fc222ac021156e09256d Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 1 Nov 2013 11:03:40 +0000 Subject: [PATCH] Made sure that File::createLink on win32 works even if CoInitialize hasn't been called. --- modules/juce_core/native/juce_win32_Files.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 6f724846a5..866d2d3b13 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -630,6 +630,8 @@ bool File::createLink (const String& description, const File& linkFileToCreate) ComSmartPtr shellLink; ComSmartPtr persistFile; + CoInitialize (0); + return SUCCEEDED (shellLink.CoCreateInstance (CLSID_ShellLink)) && SUCCEEDED (shellLink->SetPath (getFullPathName().toWideCharPointer())) && SUCCEEDED (shellLink->SetDescription (description.toWideCharPointer()))