Skip to content

Commit

Permalink
Fix ActiveX
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Feb 27, 2023
1 parent 779a21c commit 498de1a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ ignored/*.*
*.suo
/.vs
/.xs
/build*
/build*

/cmake-*
2 changes: 1 addition & 1 deletion 3rdParty/scintilla/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# <Author> <Time> <Version> <Des>
# guoyou 2016-10-14 1.0
#-------------------------------------------------------
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.21)
PROJECT(scintilla)

# 文件分组(过滤),同时必须加入到ADD_LIBRARY中才能显示
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# guoyou 2015-1-5 1.0
# k000 2017-07-11 修复项目作为子项目引入时PrecompiledHeader.cmake路径错误
#-------------------------------------------------------
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.21)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

cmake_policy(SET CMP0079 NEW)
Expand Down
12 changes: 6 additions & 6 deletions DmMain/inc/Common/ActiveX/DMActiveXBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ namespace DM
break;
}

DMComQIPtr<IPersistStreamInit> spPSI = (DMComQIPtr<IPersistStreamInit>&)spControl;
DMComQIPtr<IPersistStreamInit> spPSI(spControl);
if (spPSI != NULL)
{
if (pStream != NULL)
Expand Down Expand Up @@ -390,7 +390,7 @@ namespace DM
break;
}

DMComQIPtr<IPersistStreamInit> spPSI = (DMComQIPtr<IPersistStreamInit>&)m_spControl;
DMComQIPtr<IPersistStreamInit> spPSI(m_spControl);
if (spPSI != NULL)
{
if (pStream != NULL)
Expand Down Expand Up @@ -435,7 +435,7 @@ namespace DM
if (m_dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)
{
hr = spOleObject->SetClientSite(static_cast<IOleClientSite*>(this));
DMComQIPtr<IOleWindow> ole_window = (DMComQIPtr<IOleWindow>&)m_spGitControl;
DMComQIPtr<IOleWindow> ole_window(m_spGitControl);
HWND hWnd = NULL;
ole_window->GetWindow(&hWnd);

Expand Down Expand Up @@ -477,7 +477,7 @@ namespace DM
if (m_dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)
{
hr = m_spOleObject->SetClientSite(static_cast<IOleClientSite*>(this));
DMComQIPtr<IOleWindow> ole_window = (DMComQIPtr<IOleWindow>&)m_spControl;
DMComQIPtr<IOleWindow> ole_window(m_spControl);
HWND hWnd = NULL;
ole_window->GetWindow(&hWnd);

Expand Down Expand Up @@ -1223,7 +1223,7 @@ namespace DM
{
// todo.
}
DMComQIPtr<IAdviseSink> advise_sink = (DMComQIPtr<IAdviseSink>&)m_spGitControl;
DMComQIPtr<IAdviseSink> advise_sink(m_spGitControl);
m_spGitOleObject->Advise(advise_sink, &m_dwOleObjSink);

if (m_spGitViewObject)
Expand Down Expand Up @@ -1257,7 +1257,7 @@ namespace DM
m_dwViewObjectType = 1;
}
}
DMComQIPtr<IAdviseSink> advise_sink = (DMComQIPtr<IAdviseSink>&)m_spControl;
DMComQIPtr<IAdviseSink> advise_sink(m_spControl);
m_spOleObject->Advise(advise_sink, &m_dwOleObjSink);

if (m_spViewObject)
Expand Down
2 changes: 1 addition & 1 deletion DmMain/src/Widgets/DUIActiveX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace DM
{
break;
}
DMComQIPtr<IOleWindow> pOleWnd = (DMComQIPtr<IOleWindow>&)pUnknown;
DMComQIPtr<IOleWindow> pOleWnd(pUnknown);
if (NULL == pOleWnd)
{
break;
Expand Down
9 changes: 5 additions & 4 deletions DmMain/src/Widgets/DUIIE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ namespace DM
break;
}

DMComQIPtr<IOleInPlaceActiveObject> spInPlaceActiveObject = (DMComQIPtr<IOleInPlaceActiveObject>&)pWeb;
DMComQIPtr<IOleInPlaceActiveObject> spInPlaceActiveObject(pWeb);
if (spInPlaceActiveObject)
{
bRet =(S_OK == spInPlaceActiveObject->TranslateAccelerator(pMsg))?true:false;
Expand All @@ -676,7 +676,7 @@ namespace DM
HRESULT hr = E_FAIL;
do
{
DMComQIPtr<IConnectionPointContainer> pCPC = (DMComQIPtr<IConnectionPointContainer>&)Ptr();
DMComQIPtr<IConnectionPointContainer> pCPC(Ptr());
if (!pCPC)
{
break;
Expand Down Expand Up @@ -844,7 +844,7 @@ namespace DM
break;
}

DMComQIPtr<IOleWindow> pOleWnd = (DMComQIPtr<IOleWindow>&)pUnknown;
DMComQIPtr<IOleWindow> pOleWnd(pUnknown);
if (NULL == pOleWnd)
{
break;
Expand Down Expand Up @@ -1062,7 +1062,8 @@ namespace DM
try
{
_bstr_t _bsScript(pszScript);
hr = spWin->execScript(_bsScript, _bstr_t(L"JavaScript"), &vRetCode);
_bstr_t _bsScriptType(L"JavaScript");
hr = spWin->execScript(_bsScript, _bsScriptType, &vRetCode);
}
catch(...)
{
Expand Down
4 changes: 2 additions & 2 deletions ci/build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Install latest cmake version for appveyor ci
# refer to: https://docs.github.com/en/actions/learn-github-actions/environment-variables
if (!($env:GITHUB_ACTIONS -eq 'true')) {
$cmake_ver="3.25.2"
# Install newer cmake for appveyor ci
$cmake_ver="3.24.3"
if(!(Test-Path ".\cmake-$cmake_ver-windows-x86_64\bin" -PathType Container)) {
curl "https://github.com/Kitware/CMake/releases/download/v$cmake_ver/cmake-$cmake_ver-windows-x86_64.zip" -o "cmake-$cmake_ver-windows-x86_64.zip"
Expand-Archive -Path cmake-$cmake_ver-windows-x86_64.zip -DestinationPath .\
Expand Down

0 comments on commit 498de1a

Please sign in to comment.