From 57f69fde9fd3310882604bbd985601e2a29dc86a Mon Sep 17 00:00:00 2001 From: Jinhao Date: Fri, 11 May 2018 17:15:32 +0800 Subject: [PATCH] fix a compiler error for VC++ --- include/nana/c++defines.hpp | 2 +- source/system/platform.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nana/c++defines.hpp b/include/nana/c++defines.hpp index f99ed990..1613f9b8 100644 --- a/include/nana/c++defines.hpp +++ b/include/nana/c++defines.hpp @@ -77,7 +77,7 @@ // Select platform ...... #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) //Microsoft Windows #define NANA_WINDOWS - typedef DWORD_PTR thread_t; + typedef unsigned long thread_t; // MINGW ... #if defined(__MINGW32__) || defined(__MINGW64__) || defined(MINGW) diff --git a/source/system/platform.cpp b/source/system/platform.cpp index 21f1086b..107d26f7 100644 --- a/source/system/platform.cpp +++ b/source/system/platform.cpp @@ -144,14 +144,14 @@ namespace system return; #if defined(NANA_WINDOWS) - if(::ShellExecute(0, L"open", url.c_str(), 0, 0, SW_SHOWNORMAL) < reinterpret_cast(32)) + if(::ShellExecute(0, L"open", nana::to_wstring(url_utf8).c_str(), 0, 0, SW_SHOWNORMAL) < reinterpret_cast(32)) { //Because ShellExecute can delegate execution to Shell extensions (data sources, context menu handlers, //verb implementations) that are activated using Component Object Model (COM), COM should be initialized //before ShellExecute is called. Some Shell extensions require the COM single-threaded apartment (STA) type. //In that case, COM should be initialized under WinXP. nana::detail::platform_spec::co_initializer co_init; - ::ShellExecute(0, L"open", url.c_str(), 0, 0, SW_SHOWNORMAL); + ::ShellExecute(0, L"open", nana::to_wstring(url_utf8).c_str(), 0, 0, SW_SHOWNORMAL); } #elif defined(NANA_POSIX) posix_open_url(url_utf8.c_str());