[Ttssh2-commit] [8350] メンバ変数 m_hInst を使用するようにした

scmno****@osdn***** scmno****@osdn*****
2019年 10月 30日 (水) 22:32:32 JST


Revision: 8350
          https://osdn.net/projects/ttssh2/scm/svn/commits/8350
Author:   zmatsuo
Date:     2019-10-30 22:32:32 +0900 (Wed, 30 Oct 2019)
Log Message:
-----------
メンバ変数 m_hInst を使用するようにした

- グローバル関数 GetInstance() を使用しないようにした

Modified Paths:
--------------
    trunk/teraterm/ttpmacro/ttmacro.cpp
    trunk/teraterm/ttpmacro/ttmmain.cpp
    trunk/teraterm/ttpmacro/ttmmain.h

-------------- next part --------------
Modified: trunk/teraterm/ttpmacro/ttmacro.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmacro.cpp	2019-10-30 13:32:15 UTC (rev 8349)
+++ trunk/teraterm/ttpmacro/ttmacro.cpp	2019-10-30 13:32:32 UTC (rev 8350)
@@ -138,7 +138,7 @@
 	init();
 
 	Busy = TRUE;
-	pCCtrlWindow = new CCtrlWindow();
+	pCCtrlWindow = new CCtrlWindow(hInst);
 	pCCtrlWindow->Create();
 	Busy = FALSE;
 

Modified: trunk/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.cpp	2019-10-30 13:32:15 UTC (rev 8349)
+++ trunk/teraterm/ttpmacro/ttmmain.cpp	2019-10-30 13:32:32 UTC (rev 8350)
@@ -81,17 +81,15 @@
 }
 
 // CCtrlWindow dialog
-CCtrlWindow::CCtrlWindow()
+CCtrlWindow::CCtrlWindow(HINSTANCE hInst)
 {
-	HINSTANCE hInst = GetInstance();
+	m_hInst = hInst;
 	m_hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TTMACRO));
 }
 
 BOOL CCtrlWindow::Create()
 {
-	HINSTANCE hInst = GetInstance();
-	HWND parent = NULL;
-	if (! TTCDialog::Create(hInst, parent, CCtrlWindow::IDD)) {
+	if (! TTCDialog::Create(m_hInst, NULL, CCtrlWindow::IDD)) {
 		PostQuitMessage(0);
 		return FALSE;
 	}
@@ -258,7 +256,6 @@
 	int fuLoad = LR_DEFAULTCOLOR;
 	RECT rc_dlg, rc_filename, rc_lineno;
 	LONG dlg_len, len;
-	HINSTANCE hInst = GetInstance();
 
 	SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), UILanguageFile);
 
@@ -268,11 +265,11 @@
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_SMALL,
-	              (LPARAM)LoadImage(hInst,
+	              (LPARAM)LoadImage(m_hInst,
 	                                MAKEINTRESOURCE(IDI_TTMACRO),
 	                                IMAGE_ICON,16,16,fuLoad));
 	::PostMessage(GetSafeHwnd(),WM_SETICON,ICON_BIG,
-	              (LPARAM)LoadImage(hInst,
+	              (LPARAM)LoadImage(m_hInst,
 	                                MAKEINTRESOURCE(IDI_TTMACRO),
 	                                IMAGE_ICON,0,0,fuLoad));
 

Modified: trunk/teraterm/ttpmacro/ttmmain.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.h	2019-10-30 13:32:15 UTC (rev 8349)
+++ trunk/teraterm/ttpmacro/ttmmain.h	2019-10-30 13:32:32 UTC (rev 8350)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2017 TeraTerm Project
+ * (C) 2007-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
 {
 public:
 	BOOL Pause;
-	CCtrlWindow();
+	CCtrlWindow(HINSTANCE hInst);
 	int Create();
 	BOOL OnIdle();
 


Ttssh2-commit メーリングリストの案内