Browse Source

【模块名称】
GM模块
【问题原因】
解决编译失败问题
【修改描述】
删除AFX相关的宏与头文件,并且Lib或Dll要使用对应的MT或MD。
【测试结果】

sat23 3 years ago
parent
commit
6a395dd4b2
3 changed files with 5 additions and 28 deletions
  1. 0 11
      gm/gm/framework.h
  2. 1 13
      gm/gm/gm.cpp
  3. 4 4
      gm/gm/gm.vcxproj

+ 0 - 11
gm/gm/framework.h

@@ -2,22 +2,11 @@
 
 #include "targetver.h"
 #define WIN32_LEAN_AND_MEAN             // 从 Windows 头文件中排除极少使用的内容
-#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 部分 CString 构造函数将是显式的
-#define _AFX_NO_MFC_CONTROLS_IN_DIALOGS         // 移除对话框中的 MFC 控件支持
 
 #ifndef VC_EXTRALEAN
 #define VC_EXTRALEAN            // 从 Windows 头文件中排除极少使用的内容
 #endif
 
-#include <afx.h>
-#include <afxwin.h>         // MFC 核心组件和标准组件
-#include <afxext.h>         // MFC 扩展
-#ifndef _AFX_NO_OLE_SUPPORT
-#include <afxdtctl.h>           // MFC 对 Internet Explorer 4 公共控件的支持
-#endif
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h>                     // MFC 对 Windows 公共控件的支持
-#endif // _AFX_NO_AFXCMN_SUPPORT
 
 #include <iostream>
 // Windows 头文件

+ 1 - 13
gm/gm/gm.cpp

@@ -12,8 +12,6 @@
 
 // 唯一的应用程序对象
 
-CWinApp theApp;
-
 using namespace std;
 
 int main()
@@ -24,17 +22,7 @@ int main()
 
     if (hModule != nullptr)
     {
-        // 初始化 MFC 并在失败时显示错误
-        if (!AfxWinInit(hModule, nullptr, ::GetCommandLine(), 0))
-        {
-            // TODO: 在此处为应用程序的行为编写代码。
-            wprintf(L"错误: MFC 初始化失败\n");
-            nRetCode = 1;
-        }
-        else
-        {
-            // TODO: 在此处为应用程序的行为编写代码。
-        }
+
     }
     else
     {

+ 4 - 4
gm/gm/gm.vcxproj

@@ -31,7 +31,7 @@
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v142</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
-    <UseOfMfc>Dynamic</UseOfMfc>
+    <UseOfMfc>false</UseOfMfc>
     <PreferredToolArchitecture>x86</PreferredToolArchitecture>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -95,7 +95,7 @@
       <ConformanceMode>true</ConformanceMode>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <AdditionalIncludeDirectories>.;..\..\Blackbone\src;..\3rd_party\include;..\..\Blackbone\src\3rd_party\AsmJit;.\core</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;..\..\..\Blackbone\src;..\3rd_party\include;..\..\..\Blackbone\src\3rd_party\AsmJit;.\core</AdditionalIncludeDirectories>
       <LanguageStandard>stdcpp17</LanguageStandard>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
@@ -103,8 +103,8 @@
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableUAC>false</EnableUAC>
-      <AdditionalLibraryDirectories>../3rd_party/lib/x86;../../Blackbone/build/Win32/Debug(DLL);..\..\Blackbone\src\3rd_party\BeaEngine\Win32\DLL;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>BlackBone.lib;minhook.lib;BeaEngine.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
+      <AdditionalLibraryDirectories>..\3rd_party\lib\x86;..\..\..\Blackbone\build\Win32\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>BlackBone.lib;minhook.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
       <IgnoreSpecificDefaultLibraries>
       </IgnoreSpecificDefaultLibraries>
     </Link>