From b1971e614ca55fbbff2500203b6ad12a48c1121a Mon Sep 17 00:00:00 2001 From: "Chaobin, Zhang" Date: Wed, 10 Sep 2014 09:11:53 +0000 Subject: [PATCH] Fix mingw build error of ITaskbarList3. Author: Chaobin Zhang git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/taskbarbutton.h | 2 +- src/msw/taskbarbutton.cpp | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/wx/msw/taskbarbutton.h b/include/wx/msw/taskbarbutton.h index bcde84f08c..c88d1f36b0 100644 --- a/include/wx/msw/taskbarbutton.h +++ b/include/wx/msw/taskbarbutton.h @@ -17,7 +17,7 @@ struct ITaskbarList3; -class wxTaskBarButtonImpl : public wxTaskBarButton { +class WXDLLIMPEXP_ADV wxTaskBarButtonImpl : public wxTaskBarButton { public: virtual ~wxTaskBarButtonImpl(); diff --git a/src/msw/taskbarbutton.cpp b/src/msw/taskbarbutton.cpp index e299fd7565..0432e55fb0 100644 --- a/src/msw/taskbarbutton.cpp +++ b/src/msw/taskbarbutton.cpp @@ -25,12 +25,16 @@ #include "wx/taskbarbutton.h" #include +#include namespace { // The maximum number of thumbnail toolbar buttons allowed on windows is 7. static const int LIMITED_BUTTON_SIZE = 7; +DEFINE_GUID(wxCLSID_TaskbarList, + 0x56fdf344, 0xfd6d, 0x11d0, 0x95, 0x8a, 0x0, 0x60, 0x97, 0xc9, 0xa0, 0x90); + THUMBBUTTONFLAGS GetNativeThumbButtonFlags(const wxThumbBarButton& button) { WXUINT flags = 0; @@ -75,15 +79,15 @@ wxTaskBarButtonImpl::wxTaskBarButtonImpl(WXWidget parent) { HRESULT hr = CoCreateInstance ( - CLSID_TaskbarList, + wxCLSID_TaskbarList, NULL, - CLSCTX_ALL, + CLSCTX_INPROC_SERVER, IID_ITaskbarList3, reinterpret_cast(&m_taskbarList) ); if ( FAILED(hr) ) { - wxLogApiError(wxT("CoCreateInstance(CLSID_TaskbarButtonList)"), hr); + wxLogApiError(wxT("CoCreateInstance(CLSID_TaskbarList)"), hr); return; } @@ -230,14 +234,14 @@ bool wxTaskBarButtonImpl::InitOrUpdateThumbBarButtons() memset(&buttons[i], 0, sizeof buttons[i]); buttons[i].iId = i; buttons[i].dwFlags = THBF_HIDDEN; - buttons[i].dwMask = THB_FLAGS; + buttons[i].dwMask = static_cast(THB_FLAGS); } for ( i = 0; i < m_thumbBarButtons.size(); ++i ) { buttons[i].hIcon = GetHiconOf(m_thumbBarButtons[i]->GetIcon()); buttons[i].dwFlags = GetNativeThumbButtonFlags(*m_thumbBarButtons[i]); - buttons[i].dwMask = THB_ICON | THB_FLAGS; + buttons[i].dwMask = static_cast(THB_ICON | THB_FLAGS); wxString tooltip = m_thumbBarButtons[i]->GetTooltip(); if ( tooltip.empty() ) continue; @@ -247,7 +251,8 @@ bool wxTaskBarButtonImpl::InitOrUpdateThumbBarButtons() if ( tooltip.length() > WXSIZEOF(buttons[i].szTip) ) tooltip = tooltip.SubString(0, WXSIZEOF(buttons[i].szTip) - 1); wxStrlcpy(buttons[i].szTip, tooltip.t_str(), tooltip.length()); - buttons[i].dwMask |= THB_TOOLTIP; + buttons[i].dwMask = + static_cast(buttons[i].dwMask | THB_TOOLTIP); } if ( !m_hasInitThumbnailToolbar )