Browse Source

Made sure that File::createLink on win32 works even if CoInitialize hasn't been called.

tags/2021-05-28
jules 11 years ago
parent
commit
fb3b5035aa
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      modules/juce_core/native/juce_win32_Files.cpp

+ 2
- 0
modules/juce_core/native/juce_win32_Files.cpp View File

@@ -630,6 +630,8 @@ bool File::createLink (const String& description, const File& linkFileToCreate)
ComSmartPtr<IShellLink> shellLink;
ComSmartPtr<IPersistFile> persistFile;
CoInitialize (0);
return SUCCEEDED (shellLink.CoCreateInstance (CLSID_ShellLink))
&& SUCCEEDED (shellLink->SetPath (getFullPathName().toWideCharPointer()))
&& SUCCEEDED (shellLink->SetDescription (description.toWideCharPointer()))


Loading…
Cancel
Save