From 2c5ce5956415cda0f30ae6d9eb703b03f1e2b799 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Sun, 3 Apr 2011 17:48:54 +0900 Subject: [PATCH] Add a solution file and project files for Microsoft Visual Studio 10.0. Fix a compile error, a heap corruption bug and a infinite loop bug. Remove obsolete DESCRIPTION in xkeymacsdll.def. --- xkeymacs-vc10x64.sln | 26 +++++ xkeymacs-vc10x86.sln | 26 +++++ xkeymacs/profile.cpp | 2 +- xkeymacs/xkeymacs-vc10x64.vcxproj | 137 +++++++++++++++++++++++++++ xkeymacs/xkeymacs-vc10x64.vcxproj.filters | 107 +++++++++++++++++++++ xkeymacs/xkeymacs-vc10x86.vcxproj | 137 +++++++++++++++++++++++++++ xkeymacs/xkeymacs-vc10x86.vcxproj.filters | 107 +++++++++++++++++++++ xkeymacs/xkeymacs.cpp | 2 - xkeymacsdll/Commands.cpp | 2 +- xkeymacsdll/xkeymacsdll-vc10.vcxproj | 128 +++++++++++++++++++++++++ xkeymacsdll/xkeymacsdll-vc10.vcxproj.filters | 76 +++++++++++++++ xkeymacsdll/xkeymacsdll.def | 1 - 12 files changed, 746 insertions(+), 5 deletions(-) create mode 100644 xkeymacs-vc10x64.sln create mode 100644 xkeymacs-vc10x86.sln create mode 100644 xkeymacs/xkeymacs-vc10x64.vcxproj create mode 100644 xkeymacs/xkeymacs-vc10x64.vcxproj.filters create mode 100644 xkeymacs/xkeymacs-vc10x86.vcxproj create mode 100644 xkeymacs/xkeymacs-vc10x86.vcxproj.filters create mode 100644 xkeymacsdll/xkeymacsdll-vc10.vcxproj create mode 100644 xkeymacsdll/xkeymacsdll-vc10.vcxproj.filters diff --git a/xkeymacs-vc10x64.sln b/xkeymacs-vc10x64.sln new file mode 100644 index 0000000..2699727 --- /dev/null +++ b/xkeymacs-vc10x64.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xkeymacs-vc10x64", "xkeymacs\xkeymacs-vc10x64.vcxproj", "{1F0783CC-C97E-F407-3004-5ED921B85CB2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xkeymacsdll-vc10", "xkeymacsdll\xkeymacsdll-vc10.vcxproj", "{6E0D026B-0162-ECF5-9DB6-3D5EC4311906}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1F0783CC-C97E-F407-3004-5ED921B85CB2}.Debug|Win32.ActiveCfg = Debug|Win32 + {1F0783CC-C97E-F407-3004-5ED921B85CB2}.Debug|Win32.Build.0 = Debug|Win32 + {1F0783CC-C97E-F407-3004-5ED921B85CB2}.Release|Win32.ActiveCfg = Release|Win32 + {1F0783CC-C97E-F407-3004-5ED921B85CB2}.Release|Win32.Build.0 = Release|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Debug|Win32.ActiveCfg = Debug|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Debug|Win32.Build.0 = Debug|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Release|Win32.ActiveCfg = Release|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/xkeymacs-vc10x86.sln b/xkeymacs-vc10x86.sln new file mode 100644 index 0000000..4f851dc --- /dev/null +++ b/xkeymacs-vc10x86.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xkeymacs-vc10x86", "xkeymacs\xkeymacs-vc10x86.vcxproj", "{20CA6A6B-A4E3-BE1A-6083-4AF4AC0874D8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xkeymacsdll-vc10", "xkeymacsdll\xkeymacsdll-vc10.vcxproj", "{6E0D026B-0162-ECF5-9DB6-3D5EC4311906}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {20CA6A6B-A4E3-BE1A-6083-4AF4AC0874D8}.Debug|Win32.ActiveCfg = Debug|Win32 + {20CA6A6B-A4E3-BE1A-6083-4AF4AC0874D8}.Debug|Win32.Build.0 = Debug|Win32 + {20CA6A6B-A4E3-BE1A-6083-4AF4AC0874D8}.Release|Win32.ActiveCfg = Release|Win32 + {20CA6A6B-A4E3-BE1A-6083-4AF4AC0874D8}.Release|Win32.Build.0 = Release|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Debug|Win32.ActiveCfg = Debug|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Debug|Win32.Build.0 = Debug|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Release|Win32.ActiveCfg = Release|Win32 + {6E0D026B-0162-ECF5-9DB6-3D5EC4311906}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/xkeymacs/profile.cpp b/xkeymacs/profile.cpp index 02ea29c..3d814bd 100644 --- a/xkeymacs/profile.cpp +++ b/xkeymacs/profile.cpp @@ -1261,7 +1261,7 @@ void CProfile::DeleteAllRegistryData() DWORD dwName = sizeof(szName); FILETIME filetime; - while (RegEnumKeyEx(hkey, dwIndex, szName, &dwName, NULL, NULL, NULL, &filetime) == ERROR_SUCCESS) { + while (RegEnumKeyEx(hkey, dwIndex++, szName, &dwName, NULL, NULL, NULL, &filetime) == ERROR_SUCCESS) { // RegDeleteKey(hkey, szName); SHDeleteKey(hkey, szName); ZeroMemory(szName, sizeof(szName)); diff --git a/xkeymacs/xkeymacs-vc10x64.vcxproj b/xkeymacs/xkeymacs-vc10x64.vcxproj new file mode 100644 index 0000000..85245c3 --- /dev/null +++ b/xkeymacs/xkeymacs-vc10x64.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + Win32Proj + + + + Application + true + Dynamic + MultiByte + + + Application + false + Dynamic + MultiByte + + + + + + + + + + + + + true + + + false + xkeymacs + + + + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + Disabled + C:\WinDDK\7600.16385.1\inc\mfc42 + false + false + + + MachineX86 + true + Windows + C:\WinDDK\7600.16385.1\lib\Mfc\i386;C:\WinDDK\7600.16385.1\lib\ATL\i386 + Version.lib;ShLwApi.Lib;Imm32.lib + $(IntDir)$(TargetName).pdb + + + C:\WinDDK\7600.16385.1\inc\mfc42 + + + + + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + ProgramDatabase + C:\WinDDK\7600.16385.1\inc\mfc42 + false + MinSpace + true + false + + + MachineX86 + true + Windows + true + true + C:\WinDDK\7600.16385.1\lib\Mfc\i386;C:\WinDDK\7600.16385.1\lib\ATL\i386 + Version.lib;Imm32.lib;ShLwApi.Lib + $(IntDir)$(TargetName).pdb + + + C:\WinDDK\7600.16385.1\inc\mfc42 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {6e0d026b-0162-ecf5-9db6-3d5ec4311906} + + + + + + \ No newline at end of file diff --git a/xkeymacs/xkeymacs-vc10x64.vcxproj.filters b/xkeymacs/xkeymacs-vc10x64.vcxproj.filters new file mode 100644 index 0000000..dfaf6f0 --- /dev/null +++ b/xkeymacs/xkeymacs-vc10x64.vcxproj.filters @@ -0,0 +1,107 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/xkeymacs/xkeymacs-vc10x86.vcxproj b/xkeymacs/xkeymacs-vc10x86.vcxproj new file mode 100644 index 0000000..85245c3 --- /dev/null +++ b/xkeymacs/xkeymacs-vc10x86.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + Win32Proj + + + + Application + true + Dynamic + MultiByte + + + Application + false + Dynamic + MultiByte + + + + + + + + + + + + + true + + + false + xkeymacs + + + + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + Disabled + C:\WinDDK\7600.16385.1\inc\mfc42 + false + false + + + MachineX86 + true + Windows + C:\WinDDK\7600.16385.1\lib\Mfc\i386;C:\WinDDK\7600.16385.1\lib\ATL\i386 + Version.lib;ShLwApi.Lib;Imm32.lib + $(IntDir)$(TargetName).pdb + + + C:\WinDDK\7600.16385.1\inc\mfc42 + + + + + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + ProgramDatabase + C:\WinDDK\7600.16385.1\inc\mfc42 + false + MinSpace + true + false + + + MachineX86 + true + Windows + true + true + C:\WinDDK\7600.16385.1\lib\Mfc\i386;C:\WinDDK\7600.16385.1\lib\ATL\i386 + Version.lib;Imm32.lib;ShLwApi.Lib + $(IntDir)$(TargetName).pdb + + + C:\WinDDK\7600.16385.1\inc\mfc42 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {6e0d026b-0162-ecf5-9db6-3d5ec4311906} + + + + + + \ No newline at end of file diff --git a/xkeymacs/xkeymacs-vc10x86.vcxproj.filters b/xkeymacs/xkeymacs-vc10x86.vcxproj.filters new file mode 100644 index 0000000..dfaf6f0 --- /dev/null +++ b/xkeymacs/xkeymacs-vc10x86.vcxproj.filters @@ -0,0 +1,107 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/xkeymacs/xkeymacs.cpp b/xkeymacs/xkeymacs.cpp index af4e18e..8b5c306 100644 --- a/xkeymacs/xkeymacs.cpp +++ b/xkeymacs/xkeymacs.cpp @@ -73,8 +73,6 @@ BOOL CXkeymacsApp::InitInstance() // such as the name of your company or organization. // SetRegistryKey(_T("Local AppWizard-Generated Applications")); SetRegistryKey(IDS_REGISTRY_KEY); - free((void*)m_pszProfileName); - m_pszProfileName=_tcsdup(_T("XKeymacs2")); // // LoadStdProfileSettings(); // Load standard INI file options (including MRU) diff --git a/xkeymacsdll/Commands.cpp b/xkeymacsdll/Commands.cpp index 5b6cf64..a5d4d60 100644 --- a/xkeymacsdll/Commands.cpp +++ b/xkeymacsdll/Commands.cpp @@ -3342,7 +3342,7 @@ int CCommands::SystemMenuEdit(const CONSOLE_MENU_EDIT nDown) return GetLastError(); } - const y = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU) * 6 + 20; // y = A + B * 6 + 20 + const int y = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU) * 6 + 20; // y = A + B * 6 + 20 const POINT clickPoint = {consoleWindowRect.left + 50, consoleWindowRect.top + y}; // 146 <= y <= 161 on W2K (146 + 161 + 1) / 2 = 154 = 19 + 19 x 6 + 21 int rc = Click(&clickPoint); // 157 <= y <= 172 on WXP (157 + 172 + 1) / 2 = 165 = 26 + 20 x 6 + 19 if (rc != ERROR_SUCCESS) { diff --git a/xkeymacsdll/xkeymacsdll-vc10.vcxproj b/xkeymacsdll/xkeymacsdll-vc10.vcxproj new file mode 100644 index 0000000..5b4ce5e --- /dev/null +++ b/xkeymacsdll/xkeymacsdll-vc10.vcxproj @@ -0,0 +1,128 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + Win32Proj + + + + DynamicLibrary + true + Dynamic + MultiByte + + + DynamicLibrary + false + Dynamic + MultiByte + + + + + + + + + + + + + true + xkeymacs + + + false + xkeymacs + + + + WIN32;_DEBUG;_WINDOWS;_AFXEXT;XKEYMACSDLLVC10_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level4 + ProgramDatabase + Disabled + C:\WinDDK\7600.16385.1\inc\mfc42 + false + false + + + MachineX86 + true + Windows + C:\WinDDK\7600.16385.1\lib\Mfc\i386;C:\WinDDK\7600.16385.1\lib\ATL\i386 + xkeymacsdll.def + Imm32.lib + $(IntDir)$(TargetName).lib + $(IntDir)$(TargetName).pdb + + + C:\WinDDK\7600.16385.1\inc\mfc42 + + + + + WIN32;NDEBUG;_WINDOWS;_AFXEXT;XKEYMACSDLLVC10_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level4 + ProgramDatabase + C:\WinDDK\7600.16385.1\inc\mfc42 + false + MinSpace + false + true + + + MachineX86 + true + Windows + true + true + C:\WinDDK\7600.16385.1\lib\Mfc\i386;C:\WinDDK\7600.16385.1\lib\ATL\i386 + xkeymacsdll.def + Imm32.lib + $(IntDir)$(TargetName).lib + $(IntDir)$(TargetName).pdb + + + C:\WinDDK\7600.16385.1\inc\mfc42 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xkeymacsdll/xkeymacsdll-vc10.vcxproj.filters b/xkeymacsdll/xkeymacsdll-vc10.vcxproj.filters new file mode 100644 index 0000000..2e2d8a0 --- /dev/null +++ b/xkeymacsdll/xkeymacsdll-vc10.vcxproj.filters @@ -0,0 +1,76 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/xkeymacsdll/xkeymacsdll.def b/xkeymacsdll/xkeymacsdll.def index fef68f0..5387be7 100644 --- a/xkeymacsdll/xkeymacsdll.def +++ b/xkeymacsdll/xkeymacsdll.def @@ -1,7 +1,6 @@ ; xkeymacsdll.def : Declares the module parameters for the DLL. LIBRARY "xkeymacs" -DESCRIPTION 'xkeymacs Windows Dynamic Link Library' EXPORTS ; Explicit exports can go here -- 2.11.0