diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 0ae5092b43..457720ffbe 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -4,6 +4,7 @@ #include "atom/browser/native_window_views.h" +#include #include #include @@ -756,8 +757,9 @@ void NativeWindowViews::FlashFrame(bool flash) { void NativeWindowViews::SetSkipTaskbar(bool skip) { #if defined(OS_WIN) base::win::ScopedComPtr taskbar; - if (FAILED(taskbar.CreateInstance(CLSID_TaskbarList, NULL, - CLSCTX_INPROC_SERVER)) || + if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr, + CLSCTX_INPROC_SERVER, + IID_PPV_ARGS(&taskbar))) || FAILED(taskbar->HrInit())) return; if (skip) { diff --git a/atom/browser/ui/win/taskbar_host.cc b/atom/browser/ui/win/taskbar_host.cc index 8ca6fa48aa..b009f80902 100644 --- a/atom/browser/ui/win/taskbar_host.cc +++ b/atom/browser/ui/win/taskbar_host.cc @@ -4,6 +4,7 @@ #include "atom/browser/ui/win/taskbar_host.h" +#include #include #include "atom/browser/native_window.h" @@ -203,9 +204,9 @@ bool TaskbarHost::HandleThumbarButtonEvent(int button_id) { } bool TaskbarHost::InitializeTaskbar() { - if (FAILED(taskbar_.CreateInstance(CLSID_TaskbarList, - nullptr, - CLSCTX_INPROC_SERVER)) || + if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr, + CLSCTX_INPROC_SERVER, + IID_PPV_ARGS(&taskbar_))) || FAILED(taskbar_->HrInit())) { return false; } else { diff --git a/atom/common/platform_util_win.cc b/atom/common/platform_util_win.cc index f40423883e..ef59202026 100644 --- a/atom/common/platform_util_win.cc +++ b/atom/common/platform_util_win.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -328,7 +329,8 @@ bool MoveItemToTrash(const base::FilePath& path) { return false; base::win::ScopedComPtr pfo; - if (FAILED(pfo.CreateInstance(CLSID_FileOperation))) + if (FAILED(::CoCreateInstance(CLSID_FileOperation, nullptr, CLSCTX_ALL, + IID_PPV_ARGS(&pfo)))) return false; // Elevation prompt enabled for UAC protected files. This overrides the diff --git a/chromium_src/chrome/browser/speech/tts_win.cc b/chromium_src/chrome/browser/speech/tts_win.cc index 0b885fd49f..872ad267bd 100644 --- a/chromium_src/chrome/browser/speech/tts_win.cc +++ b/chromium_src/chrome/browser/speech/tts_win.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include +#include #include #include "base/memory/singleton.h" @@ -232,7 +233,8 @@ TtsPlatformImplWin::TtsPlatformImplWin() stream_number_(0), char_position_(0), paused_(false) { - speech_synthesizer_.CreateInstance(CLSID_SpVoice); + ::CoCreateInstance(CLSID_SpVoice, nullptr, CLSCTX_ALL, + IID_PPV_ARGS(&speech_synthesizer_)); if (speech_synthesizer_.Get()) { ULONGLONG event_mask = SPFEI(SPEI_START_INPUT_STREAM) |