From a8750a35ab02ebec39bdc45e40671edfa7a6c29b Mon Sep 17 00:00:00 2001 From: vczh Date: Fri, 5 Jun 2026 09:03:50 -0700 Subject: [PATCH] Define _WINSOCKAPI_ before Windows SDK headers --- Import/GacUI.Windows.cpp | 5 +++++ Import/GacUI.Windows.h | 6 ++++++ Import/Vlpp.Windows.cpp | 4 ++++ Import/VlppOS.Windows.cpp | 4 ++++ Import/VlppOS.Windows.h | 1 + Tutorial/GacUI_Layout/RichTextEmbedding/Main.cpp | 1 + Tutorial/Lib/GacUI/WinMain.cpp | 1 + Tutorial/Lib/GacUILite/WinMain.cpp | 1 + 8 files changed, 23 insertions(+) diff --git a/Import/GacUI.Windows.cpp b/Import/GacUI.Windows.cpp index 3478623e..b67b4095 100644 --- a/Import/GacUI.Windows.cpp +++ b/Import/GacUI.Windows.cpp @@ -7,6 +7,7 @@ DEVELOPER: Zihan Chen(vczh) /*********************************************************************** .\WINNATIVEDPIAWARENESS.CPP ***********************************************************************/ +#define _WINSOCKAPI_ #include #pragma comment(lib, "Shcore.lib") @@ -110,6 +111,7 @@ namespace vl /*********************************************************************** .\WINNATIVEWINDOW.CPP ***********************************************************************/ +#define _WINSOCKAPI_ #include #pragma comment(lib, "Imm32.lib") @@ -13255,6 +13257,7 @@ WindowsClipboardService /*********************************************************************** .\SERVICESIMPL\WINDOWSDIALOGSERVICE.CPP ***********************************************************************/ +#define _WINSOCKAPI_ #include #pragma comment(lib, "Vfw32.lib") @@ -13533,6 +13536,7 @@ WindowsDialogService /*********************************************************************** .\SERVICESIMPL\WINDOWSIMAGESERVICE.CPP ***********************************************************************/ +#define _WINSOCKAPI_ #include #pragma comment(lib, "WindowsCodecs.lib") @@ -14512,6 +14516,7 @@ WindowsResourceService /*********************************************************************** .\SERVICESIMPL\WINDOWSSCREENSERVICE.CPP ***********************************************************************/ +#define _WINSOCKAPI_ namespace vl { diff --git a/Import/GacUI.Windows.h b/Import/GacUI.Windows.h index 2f5258d1..d143c823 100644 --- a/Import/GacUI.Windows.h +++ b/Import/GacUI.Windows.h @@ -169,6 +169,7 @@ Interfaces: #ifndef VCZH_PRESENTATION_WINDOWS_GDI_WINDIRECT2DAPPLICATION #define VCZH_PRESENTATION_WINDOWS_GDI_WINDIRECT2DAPPLICATION +#define _WINSOCKAPI_ #include #include #include @@ -236,6 +237,7 @@ Interfaces: #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSWINDOWSDIRECT2D #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSWINDOWSDIRECT2D +#define _WINSOCKAPI_ #include #include @@ -1192,6 +1194,7 @@ Interfaces: #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSUNISCRIBE #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSUNISCRIBE +#define _WINSOCKAPI_ #include namespace vl @@ -1540,6 +1543,7 @@ Interfaces: #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSWINDOWSGDI #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSWINDOWSGDI +#define _WINSOCKAPI_ #include namespace vl @@ -1966,6 +1970,7 @@ Interfaces: #ifndef VCZH_PRESENTATION_WINDOWS_SERVICESIMPL_WINDOWSDIALOGSERVICE #define VCZH_PRESENTATION_WINDOWS_SERVICESIMPL_WINDOWSDIALOGSERVICE +#define _WINSOCKAPI_ #include namespace vl @@ -2009,6 +2014,7 @@ Interfaces: #ifndef VCZH_PRESENTATION_WINDOWS_SERVICESIMPL_WINDOWSIMAGESERIVCE #define VCZH_PRESENTATION_WINDOWS_SERVICESIMPL_WINDOWSIMAGESERIVCE +#define _WINSOCKAPI_ namespace vl { diff --git a/Import/Vlpp.Windows.cpp b/Import/Vlpp.Windows.cpp index 95bd0727..5e979f0d 100644 --- a/Import/Vlpp.Windows.cpp +++ b/Import/Vlpp.Windows.cpp @@ -12,6 +12,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #include #ifndef VCZH_MSVC @@ -100,6 +101,7 @@ Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ #include +#define _WINSOCKAPI_ #ifndef VCZH_MSVC static_assert(false, "Do not build this file for non-Windows applications."); @@ -250,6 +252,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #ifndef VCZH_MSVC static_assert(false, "Do not build this file for non-Windows applications."); @@ -281,6 +284,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #ifndef VCZH_MSVC static_assert(false, "Do not build this file for non-Windows applications."); diff --git a/Import/VlppOS.Windows.cpp b/Import/VlppOS.Windows.cpp index 51f2512c..cd47c421 100644 --- a/Import/VlppOS.Windows.cpp +++ b/Import/VlppOS.Windows.cpp @@ -12,6 +12,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #include #include @@ -303,6 +304,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #ifndef VCZH_MSVC static_assert(false, "Do not build this file for non-Windows applications."); @@ -627,6 +629,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #ifndef VCZH_MSVC static_assert(false, "Do not build this file for non-Windows applications."); @@ -1472,6 +1475,7 @@ Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/ +#define _WINSOCKAPI_ #ifndef VCZH_MSVC static_assert(false, "Do not build this file for non-Windows applications."); diff --git a/Import/VlppOS.Windows.h b/Import/VlppOS.Windows.h index 6860720d..dbd81602 100644 --- a/Import/VlppOS.Windows.h +++ b/Import/VlppOS.Windows.h @@ -21,6 +21,7 @@ Interfaces: #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif +#define _WINSOCKAPI_ #include #include #define RPC_USE_NATIVE_WCHAR diff --git a/Tutorial/GacUI_Layout/RichTextEmbedding/Main.cpp b/Tutorial/GacUI_Layout/RichTextEmbedding/Main.cpp index c872df23..54cf96b5 100644 --- a/Tutorial/GacUI_Layout/RichTextEmbedding/Main.cpp +++ b/Tutorial/GacUI_Layout/RichTextEmbedding/Main.cpp @@ -1,6 +1,7 @@ #define GAC_HEADER_USE_NAMESPACE #include "UI/Source/Demo.h" #ifdef VCZH_MSVC +#define _WINSOCKAPI_ #include #endif diff --git a/Tutorial/Lib/GacUI/WinMain.cpp b/Tutorial/Lib/GacUI/WinMain.cpp index fe37d771..4fc2db38 100644 --- a/Tutorial/Lib/GacUI/WinMain.cpp +++ b/Tutorial/Lib/GacUI/WinMain.cpp @@ -1,6 +1,7 @@ #define GAC_HEADER_USE_NAMESPACE #include #include +#define _WINSOCKAPI_ #include class DefaultSkinPlugin : public Object, public IGuiPlugin diff --git a/Tutorial/Lib/GacUILite/WinMain.cpp b/Tutorial/Lib/GacUILite/WinMain.cpp index fe37d771..4fc2db38 100644 --- a/Tutorial/Lib/GacUILite/WinMain.cpp +++ b/Tutorial/Lib/GacUILite/WinMain.cpp @@ -1,6 +1,7 @@ #define GAC_HEADER_USE_NAMESPACE #include #include +#define _WINSOCKAPI_ #include class DefaultSkinPlugin : public Object, public IGuiPlugin