Don't link shlwapi directly.
For MSVC use #pragma comment to link shlwapi, and for MinGW use dynamic loading of this library. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -589,7 +589,6 @@ $(TAB)$(VC_COMPILER) /EP /nologo "$(DOLLAR)(InputPath)" > "$(SETUPHDIR)\wx\msw\r
|
|||||||
<!-- this one is only used if wxUSE_URL_NATIVE==1 but we don't
|
<!-- this one is only used if wxUSE_URL_NATIVE==1 but we don't
|
||||||
know if it is here so just add it unconditionally -->
|
know if it is here so just add it unconditionally -->
|
||||||
<sys-lib>wininet</sys-lib>
|
<sys-lib>wininet</sys-lib>
|
||||||
<sys-lib>shlwapi</sys-lib>
|
|
||||||
</if>
|
</if>
|
||||||
<if cond="FORMAT=='borland'">
|
<if cond="FORMAT=='borland'">
|
||||||
<sys-lib>oleacc</sys-lib>
|
<sys-lib>oleacc</sys-lib>
|
||||||
|
@@ -299,7 +299,6 @@
|
|||||||
<sys-lib>rpcrt4</sys-lib>
|
<sys-lib>rpcrt4</sys-lib>
|
||||||
<sys-lib>advapi32</sys-lib>
|
<sys-lib>advapi32</sys-lib>
|
||||||
<sys-lib>wsock32</sys-lib>
|
<sys-lib>wsock32</sys-lib>
|
||||||
<sys-lib>shlwapi</sys-lib>
|
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<!-- Libs common to both borland and MSVC -->
|
<!-- Libs common to both borland and MSVC -->
|
||||||
|
@@ -20,7 +20,8 @@ namespace {
|
|||||||
class WXDLLIMPEXP_FWD_CORE ITaskbarList3;
|
class WXDLLIMPEXP_FWD_CORE ITaskbarList3;
|
||||||
}
|
}
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxTaskBarButtonImpl : public wxTaskBarButton {
|
class WXDLLIMPEXP_CORE wxTaskBarButtonImpl : public wxTaskBarButton
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~wxTaskBarButtonImpl();
|
virtual ~wxTaskBarButtonImpl();
|
||||||
|
|
||||||
|
@@ -21,12 +21,20 @@
|
|||||||
|
|
||||||
#if wxUSE_TASKBARBUTTON
|
#if wxUSE_TASKBARBUTTON
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "shlwapi" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
#include "wx/msw/taskbarbutton.h"
|
#include "wx/msw/taskbarbutton.h"
|
||||||
|
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
|
|
||||||
|
#if wxUSE_DYNLIB_CLASS
|
||||||
|
#include "wx/dynlib.h"
|
||||||
|
#endif // wxUSE_DYNLIB_CLASS
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Redefine the interfaces: ITaskbarList3, IObjectCollection,
|
// Redefine the interfaces: ITaskbarList3, IObjectCollection,
|
||||||
// ICustomDestinationList, IShellLink, IShellItem, IApplicationDocumentLists
|
// ICustomDestinationList, IShellLink, IShellItem, IApplicationDocumentLists
|
||||||
@@ -332,9 +340,32 @@ inline HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar)
|
|||||||
|
|
||||||
inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
|
inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
|
||||||
{
|
{
|
||||||
|
HRESULT hr = E_FAIL;
|
||||||
ppropvar->vt = VT_LPWSTR;
|
ppropvar->vt = VT_LPWSTR;
|
||||||
HRESULT hr = SHStrDupW(psz, &ppropvar->pwszVal);
|
|
||||||
if (FAILED(hr))
|
#if wxUSE_DYNLIB_CLASS
|
||||||
|
typedef HRESULT (WINAPI *SHStrDupW_t)(LPCTSTR, LPTSTR*);
|
||||||
|
static SHStrDupW_t s_pfnSHStrDupW = NULL;
|
||||||
|
if ( !s_pfnSHStrDupW )
|
||||||
|
{
|
||||||
|
wxDynamicLibrary dll(wxT("shlwapi.dll"));
|
||||||
|
if ( dll.IsLoaded() )
|
||||||
|
{
|
||||||
|
s_pfnSHStrDupW = (SHStrDupW_t)dll.GetSymbol(wxT("SHStrDupW"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( s_pfnSHStrDupW )
|
||||||
|
{
|
||||||
|
hr = s_pfnSHStrDupW(psz, &ppropvar->pwszVal);
|
||||||
|
}
|
||||||
|
#elif defined (_MSC_VER)
|
||||||
|
hr = SHStrDupW(psz, &ppropvar->pwszVal);
|
||||||
|
#else
|
||||||
|
wxUnusedVar(psz);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ( FAILED(hr) )
|
||||||
{
|
{
|
||||||
PropVariantInit(ppropvar);
|
PropVariantInit(ppropvar);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user