Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions sakura/sakura.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</Manifest>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>comctl32.lib;Imm32.lib;mpr.lib;Shlwapi.lib;Dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;Imm32.lib;mpr.lib;Shlwapi.lib;Dwmapi.lib;Htmlhelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSVCではpragma comment libを使えばリンク指示できます。
「必要ではない修正」を減らすために使えるテクニックです。

こういうの。

#include <wincodec.h>
#pragma comment(lib, "windowscodecs.lib")


静的リンクしたDLLは「必須」になるので、インストールされてない端末で実行すると落ちます。
動的ロードは「DLLがなくても落ちない機構」なので、デグレになるおそれがあります。

中間の技術として /DELAYLOAD というのがありますが、説明がダルいっす。

既存コードで Imm32.DLL が静的リンクなのは国際化の観点でNGだと思ってます。
mpr.DLLはNetConnectのためだけにリンクしてるので /DELAYLOAD で十分と思います。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと補足。HtmlHelpがあるDLLは hhctrl.ocx で、/DELAYLOAD は使えませんでした。

<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -304,7 +304,6 @@
<ClInclude Include="..\sakura_core\extmodule\CBregexp.h" />
<ClInclude Include="..\sakura_core\extmodule\CBregexpDll2.h" />
<ClInclude Include="..\sakura_core\extmodule\CDllHandler.h" />
<ClInclude Include="..\sakura_core\extmodule\CHtmlHelp.h" />
<ClInclude Include="..\sakura_core\extmodule\CIcu4cI18n.h" />
<ClInclude Include="..\sakura_core\extmodule\CMigemo.h" />
<ClInclude Include="..\sakura_core\extmodule\CUchardet.h" />
Expand Down Expand Up @@ -673,7 +672,6 @@
<ClCompile Include="..\sakura_core\extmodule\CBregexp.cpp" />
<ClCompile Include="..\sakura_core\extmodule\CBregexpDll2.cpp" />
<ClCompile Include="..\sakura_core\extmodule\CDllHandler.cpp" />
<ClCompile Include="..\sakura_core\extmodule\CHtmlHelp.cpp" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上記 pragma comment lib の記述ファイルとして残してよい気がします。

つまり、sakura.vcxprojに対する修正は、ナシでいけます。

<ClCompile Include="..\sakura_core\extmodule\CIcu4cI18n.cpp" />
<ClCompile Include="..\sakura_core\extmodule\CMigemo.cpp" />
<ClCompile Include="..\sakura_core\extmodule\CUchardet.cpp" />
Expand Down
6 changes: 0 additions & 6 deletions sakura/sakura.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,6 @@
<ClInclude Include="..\sakura_core\extmodule\CDllHandler.h">
<Filter>Cpp Source Files\extmodule</Filter>
</ClInclude>
<ClInclude Include="..\sakura_core\extmodule\CHtmlHelp.h">
<Filter>Cpp Source Files\extmodule</Filter>
</ClInclude>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ファイル削除を行わなければ、このファイルに対する修正も不要です。

<ClInclude Include="..\sakura_core\extmodule\CMigemo.h">
<Filter>Cpp Source Files\extmodule</Filter>
</ClInclude>
Expand Down Expand Up @@ -2228,9 +2225,6 @@
<ClCompile Include="..\sakura_core\extmodule\CDllHandler.cpp">
<Filter>Cpp Source Files\extmodule</Filter>
</ClCompile>
<ClCompile Include="..\sakura_core\extmodule\CHtmlHelp.cpp">
<Filter>Cpp Source Files\extmodule</Filter>
</ClCompile>
<ClCompile Include="..\sakura_core\extmodule\CMigemo.cpp">
<Filter>Cpp Source Files\extmodule</Filter>
</ClCompile>
Expand Down
1 change: 1 addition & 0 deletions sakura_core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ LIBS= \
-lmpr \
-lshlwapi \
-ldwmapi \
-lhtmlhelp \
-lwinmm \
-lwindowscodecs \
-lmsimg32 \
Expand Down
6 changes: 2 additions & 4 deletions sakura_core/String_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,6 @@

// CHokanMgr.cpp

// CHtmlHelp.cpp

// CImageListMgr.cpp

// CKeyBind.cpp
Expand Down Expand Up @@ -1005,8 +1003,8 @@
#define STR_ERR_ETCUTY01 34749
#define STR_ERR_ETCUTY02 34750
#define STR_ERR_ETCUTY03 34751
#define STR_SHELL_HHCTRL 34752
#define STR_SHELL_INFO 34753
// #define STR_SHELL_HHCTRL 34752
// #define STR_SHELL_INFO 34753
#define STR_SHELL_MENU_OPEN 34754
#define STR_SHELL_MENU_IMPEXP 34755
#define STR_SHELL_IMPEXPDIR 34756
Expand Down
45 changes: 0 additions & 45 deletions sakura_core/extmodule/CHtmlHelp.cpp

This file was deleted.

55 changes: 0 additions & 55 deletions sakura_core/extmodule/CHtmlHelp.h

This file was deleted.

2 changes: 0 additions & 2 deletions sakura_core/sakura_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2918,8 +2918,6 @@ END

STRINGTABLE
BEGIN
STR_SHELL_HHCTRL "HHCTRL.OCXが見つかりません。\r\nHTMLヘルプを利用するにはHHCTRL.OCXが必要です。\r\n"
STR_SHELL_INFO "情報"
STR_SHELL_MENU_OPEN "開く(&O)..."
STR_SHELL_MENU_IMPEXP "インポート/エクスポートの起点リセット(&R)"
STR_SHELL_IMPEXPDIR "各種設定のインポート/エクスポート用ファイル選択画面の\n初期表示フォルダーを設定フォルダーに戻します。"
Expand Down
25 changes: 2 additions & 23 deletions sakura_core/util/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "util/window.h"
#include "env/CShareData.h"
#include "env/DLLSHAREDATA.h"
#include "extmodule/CHtmlHelp.h"
#include "config/app_constants.h"
#include "String_define.h"
#include <wrl.h>
Expand Down Expand Up @@ -300,15 +299,6 @@ DWORD NetConnect ( const WCHAR strNetWorkPass[] )
return dwRet;
}

// From Here Jun. 26, 2001 genta
/*!
HTML Helpコンポーネントのアクセスを提供する。
内部で保持すべきデータは特になく、至る所から使われるのでGlobal変数にするが、
直接のアクセスはOpenHtmlHelp()関数のみから行う。
他のファイルからはCHtmlHelpクラスは隠されている。
*/
CHtmlHelp g_cHtmlHelp;

/*!
HTML Helpを開く
HTML Helpが利用可能であれば引数をそのまま渡し、そうでなければメッセージを表示する。
Expand All @@ -321,21 +311,10 @@ HWND OpenHtmlHelp(
LPCWSTR szFile, //!< [in] HTML Helpのファイル名。不等号に続けてウィンドウタイプ名を指定可能。
UINT uCmd, //!< [in] HTML Help に渡すコマンド
DWORD_PTR data, //!< [in] コマンドに応じたデータ
bool msgflag //!< [in] エラーメッセージを表示するか。省略時はtrue。
[[maybe_unused]] bool msgflag //!< [in] エラーメッセージを表示するか。省略時はtrue。
)
{
if( DLL_SUCCESS == g_cHtmlHelp.InitDll() ){
return g_cHtmlHelp.HtmlHelp( hWnd, szFile, uCmd, data );
}
if( msgflag ){
::MessageBox(
hWnd,
LS(STR_SHELL_HHCTRL),
LS(STR_SHELL_INFO),
MB_OK | MB_ICONEXCLAMATION
);
}
return nullptr;
return HtmlHelp( hWnd, szFile, uCmd, data );
}

// To Here Jun. 26, 2001 genta
Expand Down
2 changes: 0 additions & 2 deletions sakura_lang_en_US/sakura_lang_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2974,8 +2974,6 @@ END

STRINGTABLE
BEGIN
STR_SHELL_HHCTRL "HHCTRL.OCX could not be found\r\nHTML help requires HHCTRL.OCX.\r\n"
STR_SHELL_INFO "Information"
STR_SHELL_MENU_OPEN "&Open ..."
STR_SHELL_MENU_IMPEXP "Import/Export Location &Reset "
STR_SHELL_IMPEXPDIR "Reset Import/Export default folder path to\nSettings-Folder path."
Expand Down
2 changes: 0 additions & 2 deletions sakura_lang_zh_CN/sakura_lang_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2964,8 +2964,6 @@ END

STRINGTABLE
BEGIN
STR_SHELL_HHCTRL "未找到HHCTRL.OCX\r\nHTML帮助需要HHCTRL.OCX组件。\r\n"
STR_SHELL_INFO "信息"
STR_SHELL_MENU_OPEN "打开(&O)..."
STR_SHELL_MENU_IMPEXP "导入/导出位置重置(&R)"
STR_SHELL_IMPEXPDIR "将导入/导出的默认文件夹路径重置为\n设置文件夹路径。"
Expand Down
1 change: 1 addition & 0 deletions tests/unittests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ LIBS= \
-limagehlp \
-lshlwapi \
-ldwmapi \
-lhtmlhelp \
-lwinmm \
-lwindowscodecs \
-lmsimg32 \
Expand Down
2 changes: 0 additions & 2 deletions tests/unittests/test-extmodules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "TExtModule.hpp"

#include "extmodule/CBregexpDll2.h"
#include "extmodule/CHtmlHelp.h"
#include "extmodule/CIcu4cI18n.h"
#include "extmodule/CMigemo.h"
#include "extmodule/CUchardet.h"
Expand Down Expand Up @@ -73,7 +72,6 @@ REGISTER_TYPED_TEST_SUITE_P(
*/
using ExtModuleImplementations = ::testing::Types<
CBregexpDll2,
CHtmlHelp,
CIcu4cI18n,
CMigemo,
CUchardet,
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/tests1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</ResourceCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>comctl32.lib;Imm32.lib;mpr.lib;imagehlp.lib;Shlwapi.lib;Dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>comctl32.lib;Imm32.lib;mpr.lib;imagehlp.lib;Shlwapi.lib;Dwmapi.lib;Htmlhelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
Expand Down
Loading