ソースを参照

update mfc examples

ruki 3 日 前
コミット
514bde4cd6

ファイルの差分が大きいため隠しています
+ 0 - 0
docs/.vitepress/data/codes-data.js


+ 16 - 0
docs/codes/examples/mfc/shared_app/src/main.cpp

@@ -0,0 +1,16 @@
+#include "main.h"
+
+CMyApp theApp;
+
+BOOL CMyApp::InitInstance()
+{
+    m_pMainWnd = new CMyFrame();
+    m_pMainWnd->ShowWindow(m_nCmdShow);
+    m_pMainWnd->UpdateWindow();
+    return TRUE;
+}
+
+CMyFrame::CMyFrame()
+{
+    Create(NULL, _T("MFC Shared App"));
+}

+ 14 - 0
docs/codes/examples/mfc/shared_app/src/main.h

@@ -0,0 +1,14 @@
+#pragma once
+#include <afxwin.h>
+
+class CMyApp : public CWinApp
+{
+public:
+    virtual BOOL InitInstance();
+};
+
+class CMyFrame : public CFrameWnd
+{
+public:
+    CMyFrame();
+};

+ 1 - 0
docs/codes/examples/mfc/shared_app/src/mfcapp.rc

@@ -0,0 +1 @@
+#include "afxres.h"

+ 4 - 0
docs/codes/examples/mfc/shared_app/xmake.lua

@@ -0,0 +1,4 @@
+target("mfc_shared_app")
+    add_rules("win.sdk.mfc.shared_app")
+    add_files("src/*.cpp")
+    add_files("src/*.rc")

+ 7 - 0
docs/codes/examples/mfc/shared_library/src/lib.cpp

@@ -0,0 +1,7 @@
+#include <afx.h>
+#include "lib.h"
+
+void HelloMfc()
+{
+    TRACE(_T("Hello MFC\n"));
+}

+ 3 - 0
docs/codes/examples/mfc/shared_library/src/lib.h

@@ -0,0 +1,3 @@
+#pragma once
+
+__declspec(dllexport) void HelloMfc();

+ 3 - 0
docs/codes/examples/mfc/shared_library/xmake.lua

@@ -0,0 +1,3 @@
+target("mfc_shared_lib")
+    add_rules("win.sdk.mfc.shared")
+    add_files("src/*.cpp")

+ 16 - 0
docs/codes/examples/mfc/static_app/src/main.cpp

@@ -0,0 +1,16 @@
+#include "main.h"
+
+CMyApp theApp;
+
+BOOL CMyApp::InitInstance()
+{
+    m_pMainWnd = new CMyFrame();
+    m_pMainWnd->ShowWindow(m_nCmdShow);
+    m_pMainWnd->UpdateWindow();
+    return TRUE;
+}
+
+CMyFrame::CMyFrame()
+{
+    Create(NULL, _T("MFC Static App"));
+}

+ 14 - 0
docs/codes/examples/mfc/static_app/src/main.h

@@ -0,0 +1,14 @@
+#pragma once
+#include <afxwin.h>
+
+class CMyApp : public CWinApp
+{
+public:
+    virtual BOOL InitInstance();
+};
+
+class CMyFrame : public CFrameWnd
+{
+public:
+    CMyFrame();
+};

+ 1 - 0
docs/codes/examples/mfc/static_app/src/mfcapp.rc

@@ -0,0 +1 @@
+#include "afxres.h"

+ 4 - 0
docs/codes/examples/mfc/static_app/xmake.lua

@@ -0,0 +1,4 @@
+target("mfc_static_app")
+    add_rules("win.sdk.mfc.static_app")
+    add_files("src/*.cpp")
+    add_files("src/*.rc")

+ 7 - 0
docs/codes/examples/mfc/static_library/src/lib.cpp

@@ -0,0 +1,7 @@
+#include <afx.h>
+#include "lib.h"
+
+void HelloMfc()
+{
+    TRACE(_T("Hello MFC\n"));
+}

+ 3 - 0
docs/codes/examples/mfc/static_library/src/lib.h

@@ -0,0 +1,3 @@
+#pragma once
+
+void HelloMfc();

+ 3 - 0
docs/codes/examples/mfc/static_library/xmake.lua

@@ -0,0 +1,3 @@
+target("mfc_static_lib")
+    add_rules("win.sdk.mfc.static")
+    add_files("src/*.cpp")

+ 4 - 20
docs/examples/cpp/mfc.md

@@ -1,31 +1,15 @@
 ## MFC Static Library
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.static")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/static_library" />
 
 ## MFC Shared Library
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.shared")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/shared_library" />
 
 ## MFC Application (Static)
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.static_app")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/static_app" />
 
 ## MFC Application (Shared)
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.shared_app")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/shared_app" />

+ 4 - 20
docs/zh/examples/cpp/mfc.md

@@ -1,33 +1,17 @@
 
 ## MFC 静态库 {#mfc-static}
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.static")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/static_library" />
 
 ## MFC 动态库 {#mfc-shared}
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.shared")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/shared_library" />
 
 ## MFC 应用程序(静态链接){#mfc-app-static}
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.static_app")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/static_app" />
 
 ## MFC 应用程序(动态链接){#mfc-app-shared}
 
-```lua
-target("test")
-    add_rules("win.sdk.mfc.shared_app")
-    add_files("src/*.c")
-```
+<FileExplorer rootFilesDir="examples/mfc/shared_app" />
 

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません