[Ttssh2-commit] [7216] teraterm.exeが生成できるぐらい修正

アーカイブの一覧に戻る

scmno****@osdn***** scmno****@osdn*****
2018年 9月 3日 (月) 19:51:32 JST


Revision: 7216
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7216
Author:   zmatsuo
Date:     2018-09-03 19:51:32 +0900 (Mon, 03 Sep 2018)
Log Message:
-----------
teraterm.exeが生成できるぐらい修正

# Conflicts:
#	teraterm/teraterm/teraterm_nomfc.cpp

Modified Paths:
--------------
    branches/cmake/teraterm/teraterm/CMakeLists.txt
    branches/cmake/teraterm/teraterm/teraterm.cpp
    branches/cmake/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: branches/cmake/teraterm/teraterm/CMakeLists.txt
===================================================================
--- branches/cmake/teraterm/teraterm/CMakeLists.txt	2018-09-03 10:51:28 UTC (rev 7215)
+++ branches/cmake/teraterm/teraterm/CMakeLists.txt	2018-09-03 10:51:32 UTC (rev 7216)
@@ -126,8 +126,8 @@
 
 set(CMAKE_MFC_FLAG 1)
 
-set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:nafxcw.lib /NODEFAULTLIB:LIBCMT.lib")
-set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:nafxcwd.lib /NODEFAULTLIB:LIBCMTD.lib")
+#set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:nafxcw.lib /NODEFAULTLIB:LIBCMT.lib")
+#set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:nafxcwd.lib /NODEFAULTLIB:LIBCMTD.lib")
 if (MSVC)
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:imagehlp.dll /DELAYLOAD:user32.dll /DELAYLOAD:shell32.dll")
 endif()
@@ -150,10 +150,10 @@
   ttpfile
   ttpset
   ttptek
-  optimized nafxcw.lib
-  debug nafxcwd.lib
-  optimized LIBCMT.lib
-  debug LIBCMTD.lib
+#  optimized nafxcw.lib
+#  debug nafxcwd.lib
+#  optimized LIBCMT.lib
+#  debug LIBCMTD.lib
   optimized onig.lib
   debug onigd.lib
   Comctl32.lib

Modified: branches/cmake/teraterm/teraterm/teraterm.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/teraterm.cpp	2018-09-03 10:51:28 UTC (rev 7215)
+++ branches/cmake/teraterm/teraterm/teraterm.cpp	2018-09-03 10:51:32 UTC (rev 7216)
@@ -29,7 +29,7 @@
 
 /* TERATERM.EXE, main */
 
-#include "stdafx.h"
+//#include "stdafx.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include "commlib.h"
@@ -47,23 +47,8 @@
 #include "keyboard.h"
 #include "compat_win.h"
 
-#include "teraapp.h"
-
 #include "compat_w95.h"
 
-#if 0
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-BEGIN_MESSAGE_MAP(CTeraApp, CWinApp)
-	//{{AFX_MSG_MAP(CTeraApp)
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-#endif
-
 static void init()
 {
 	typedef BOOL (WINAPI *pSetDllDir)(LPCSTR);
@@ -91,29 +76,6 @@
 	}
 }
 
-#if 0
-// CTeraApp instance
-CTeraApp theApp;
-
-
-
-
-
-// CTeraApp initialization
-BOOL CTeraApp::InitInstance()
-{
-	hInst = m_hInstance;
-	m_pMainWnd = new CVTWindow();
-	pVTWin = m_pMainWnd;
-	return TRUE;
-}
-
-int CTeraApp::ExitInstance()
-{
-	return CWinApp::ExitInstance();
-}
-#endif
-
 // Tera Term main engine
 static BOOL OnIdle(LONG lCount)
 {
@@ -241,20 +203,15 @@
 	return (Busy>0);
 }
 
-BOOL CTeraApp::PreTranslateMessage(MSG* pMsg)
+BOOL CallOnIdle(LONG lCount)
 {
-	if (MetaKey(ts.MetaKey)) {
-		return FALSE; /* ignore accelerator keys */
-	}
-	else {
-		return CWinApp::PreTranslateMessage(pMsg);
-	}
+	return OnIdle(lCount);
 }
 
-
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst,
                    LPSTR lpszCmdLine, int nCmdShow)
 {
+	init();
 	hInst = hInstance;
 	CVTWindow *m_pMainWnd = new CVTWindow();
 	pVTWin = m_pMainWnd->m_hWnd;
@@ -262,6 +219,9 @@
 
 	MSG msg;
 	while (GetMessage(&msg, NULL, 0, 0)) {
+		if (MetaKey(ts.MetaKey)) {
+			continue;
+		}
         TranslateMessage(&msg);
         DispatchMessage(&msg);
     }
@@ -268,9 +228,11 @@
     return (msg.wParam);
 }
 
+#define COMPILE_NEWAPIS_STUBS 
+//#define WANT_GETDISKFREESPACEEX_WRAPPER // wrap for GetDiskFreeSpaceEx
+//#define WANT_GETLONGPATHNAME_WRAPPER // wrap for GetLongPathName
+//#define WANT_GETFILEATTRIBUTESEX_WRAPPER // wrap for GetFileAttributesEx
+#define WANT_ISDEBUGGERPRESENT_WRAPPER // wrap for wrap for IsDebuggerPresent
+#include <NewAPIs.h>
 
-BOOL CallOnIdle(LONG lCount)
-{
-	CWinApp *app = AfxGetApp();
-	return app->OnIdle(lCount);
-}
+// https://bearwindows.zcm.com.au/msvc.htm

Modified: branches/cmake/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/vtwin.cpp	2018-09-03 10:51:28 UTC (rev 7215)
+++ branches/cmake/teraterm/teraterm/vtwin.cpp	2018-09-03 10:51:32 UTC (rev 7216)
@@ -2145,9 +2145,8 @@
 		const char *FileName = DropLists[i];
 		const DWORD attr = GetFileAttributes(FileName);
 		if (attr == -1 ) {
-			goto finish;
-		}
-		if (attr & FILE_ATTRIBUTE_DIRECTORY) {
+			FileCount++;
+		} else if (attr & FILE_ATTRIBUTE_DIRECTORY) {
 			DirectoryCount++;
 		} else {
 			FileCount++;



Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る