From 45c5104ce0589ca378770e1095442e45a2fa9cc3 Mon Sep 17 00:00:00 2001 From: jiajia_deng <2894220@gmail.com> Date: Mon, 26 Aug 2019 09:52:10 +0800 Subject: [PATCH] Fixed #110 can not compile under /permissive mode --- tool_kits/duilib/Control/Button.h | 2 +- tool_kits/duilib/Control/RichEdit.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tool_kits/duilib/Control/Button.h b/tool_kits/duilib/Control/Button.h index 8e5538b0..cf8db391 100644 --- a/tool_kits/duilib/Control/Button.h +++ b/tool_kits/duilib/Control/Button.h @@ -27,7 +27,7 @@ class UILIB_API ButtonTemplate : public LabelTemplate template UINT ui::ButtonTemplate::GetControlFlags() const { - return IsKeyboardEnabled() && IsEnabled() ? UIFLAG_TABSTOP : UIFLAG_DEFAULT; + return this->IsKeyboardEnabled() && this->IsEnabled() ? UIFLAG_TABSTOP : UIFLAG_DEFAULT; } template diff --git a/tool_kits/duilib/Control/RichEdit.cpp b/tool_kits/duilib/Control/RichEdit.cpp index 4115425e..3b7af4b9 100644 --- a/tool_kits/duilib/Control/RichEdit.cpp +++ b/tool_kits/duilib/Control/RichEdit.cpp @@ -301,7 +301,9 @@ CTxtWinHost::~CTxtWinHost() BOOL CTxtWinHost::Init(RichEdit *re, const CREATESTRUCT *pcs) { + PCreateTextServices TextServicesProc = nullptr; IUnknown *pUnk = nullptr; + HMODULE hmod = NULL; HRESULT hr; std::wstring edit_dll(L"msftedit.dll"); m_re = re; @@ -349,7 +351,6 @@ BOOL CTxtWinHost::Init(RichEdit *re, const CREATESTRUCT *pcs) //if(FAILED(CreateTextServices(NULL, this, &pUnk))) // goto err; - PCreateTextServices TextServicesProc = nullptr; //解决32位系统下跨窗口间拖拽文字在win7及win7以下系统上会出现重复的问题(64位暂不修复) lty 20170714 #if defined(_M_X64) || defined(__x86_64__) edit_dll = L"msftedit.dll"; @@ -358,7 +359,7 @@ BOOL CTxtWinHost::Init(RichEdit *re, const CREATESTRUCT *pcs) if (!(::GetFileAttributesW(edit_dll.c_str()) != INVALID_FILE_ATTRIBUTES)) edit_dll = L"msftedit.dll"; #endif - HMODULE hmod = LoadLibraryW(edit_dll.c_str()); //msftedit.dll + hmod = LoadLibraryW(edit_dll.c_str()); //msftedit.dll if (hmod) { TextServicesProc = (PCreateTextServices)GetProcAddress(hmod,"CreateTextServices");