alroyso 3 سال پیش
والد
کامیت
5d89202a5f

+ 234 - 0
Base/Base.vcxproj

@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <VCProjectVersion>16.0</VCProjectVersion>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectGuid>{9cd7f2e8-8644-4de2-96dc-2e86a89e4369}</ProjectGuid>
+    <RootNamespace>Base</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>..\__bin\$(Configuration)\</OutDir>
+    <IntDir>..\__obj\$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>..\__bin\$(Configuration)\</OutDir>
+    <IntDir>..\__obj\$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>..\__bin\$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>..\__obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>..\__bin\$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>..\__obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <VcpkgUseStatic>true</VcpkgUseStatic>
+  </PropertyGroup>
+  <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <VcpkgUseStatic>true</VcpkgUseStatic>
+  </PropertyGroup>
+  <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <VcpkgUseStatic>true</VcpkgUseStatic>
+  </PropertyGroup>
+  <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <VcpkgUseStatic>true</VcpkgUseStatic>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_DEBUG;BASE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>false</ConformanceMode>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <LanguageStandard>stdcpp17</LanguageStandard>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <ForcedIncludeFiles>
+      </ForcedIncludeFiles>
+      <AdditionalIncludeDirectories>$(ProjectDir)</AdditionalIncludeDirectories>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableUAC>false</EnableUAC>
+      <ImportLibrary>..\__LIB\$(Configuration)\$(TargetName).lib</ImportLibrary>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ModuleDefinitionFile>$(ProjectDir)\BaseModule.def</ModuleDefinitionFile>
+    </Link>
+    <Manifest />
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>false</SDLCheck>
+      <PreprocessorDefinitions>WIN32;NDEBUG;BASE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>false</ConformanceMode>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <LanguageStandard>stdcpp17</LanguageStandard>
+      <AdditionalIncludeDirectories>$(ProjectDir)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableUAC>false</EnableUAC>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ModuleDefinitionFile>$(ProjectDir)\BaseModule.def</ModuleDefinitionFile>
+      <ImportLibrary>..\__LIB\$(Configuration)\$(TargetName).lib</ImportLibrary>
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_DEBUG;BASE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <LanguageStandard>stdcpp17</LanguageStandard>
+      <AdditionalIncludeDirectories>$(ProjectDir)</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableUAC>false</EnableUAC>
+      <ImportLibrary>..\__LIB\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ModuleDefinitionFile>$(ProjectDir)\BaseModule.def</ModuleDefinitionFile>
+    </Link>
+    <Manifest>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
+    </Manifest>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>false</SDLCheck>
+      <PreprocessorDefinitions>NDEBUG;BASE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>false</ConformanceMode>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <LanguageStandard>stdcpp17</LanguageStandard>
+      <AdditionalIncludeDirectories>$(ProjectDir)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableUAC>false</EnableUAC>
+      <ModuleDefinitionFile>$(ProjectDir)\BaseModule.def</ModuleDefinitionFile>
+      <AdditionalDependencies>ws2_32.lib;crypt32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ImportLibrary>..\__LIB\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="basecurl\CNetwork.h" />
+    <ClInclude Include="CBaseGloabl.h" />
+    <ClInclude Include="CUtils.h" />
+    <ClInclude Include="FileOperate.h" />
+    <ClInclude Include="framework.h" />
+    <ClInclude Include="pch.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="basecurl\CNetwork.cpp" />
+    <ClCompile Include="BaseModule.cpp" />
+    <ClCompile Include="CBaseGloabl.cpp" />
+    <ClCompile Include="CUtils.cpp" />
+    <ClCompile Include="FileOperate.cpp" />
+    <ClCompile Include="pch.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="BaseModule.def" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 65 - 0
Base/Base.vcxproj.filters

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+    <Filter Include="curl">
+      <UniqueIdentifier>{33b6830a-a1de-472e-b361-3f30c34198cc}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="framework.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="pch.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="basecurl\CNetwork.h">
+      <Filter>curl</Filter>
+    </ClInclude>
+    <ClInclude Include="CBaseGloabl.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="FileOperate.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="CUtils.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="BaseModule.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="pch.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="basecurl\CNetwork.cpp">
+      <Filter>curl</Filter>
+    </ClCompile>
+    <ClCompile Include="CBaseGloabl.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="FileOperate.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="CUtils.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="BaseModule.def">
+      <Filter>源文件</Filter>
+    </None>
+  </ItemGroup>
+</Project>

+ 6 - 0
Base/Base.vcxproj.user

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ShowAllFiles>false</ShowAllFiles>
+  </PropertyGroup>
+</Project>

+ 80 - 0
Base/BaseModule.cpp

@@ -0,0 +1,80 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "pch.h"
+
+
+#include "CBaseGloabl.h"
+
+
+//////////////////////////////////////////////////////////////////////////
+CBaseGloabl* g_pBaseGloabl = NULL;
+HMODULE g_hDllModule = NULL;
+
+//#pragma comment(linker, "/EXPORT:DllRegisterServer=_DllRegisterServer@0,PRIVATE")
+//#pragma comment(linker, "/EXPORT:DllUnregisterServer=_DllUnregisterServer@0,PRIVATE")
+//
+//
+//
+//STDAPI DllRegisterServer(void)
+//{
+//	HRESULT hr = S_OK;
+//
+//
+//	return hr;
+//}
+//
+//
+//STDAPI DllUnregisterServer(void)
+//{
+//	HRESULT hr = S_OK;
+//
+//
+//	return hr;
+//}
+
+
+
+
+BASEMODULE IBaseGloablModule* WINAPI GetBaseGlobalInstance()
+{
+
+
+	
+	if (!g_pBaseGloabl)
+		g_pBaseGloabl = new CBaseGloabl;
+
+	g_pBaseGloabl->AddRef();
+	return g_pBaseGloabl;
+}
+
+BASEMODULE BOOL WINAPI ReleaseBaseGlobalInstance()
+{
+	if (!g_pBaseGloabl)
+		return FALSE;
+
+	if (g_pBaseGloabl->Release() == 0)
+	{
+		g_pBaseGloabl = NULL;
+	}
+	return TRUE;
+}
+
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+                     )
+{
+    switch (ul_reason_for_call)
+    {
+    case DLL_PROCESS_ATTACH:
+	{
+		g_hDllModule = (HMODULE)hModule;
+	}
+    case DLL_THREAD_ATTACH:
+    case DLL_THREAD_DETACH:
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
+

+ 3 - 0
Base/BaseModule.def

@@ -0,0 +1,3 @@
+EXPORTS
+	GetBaseGlobalInstance
+	ReleaseBaseGlobalInstance

+ 45 - 0
Base/CBaseGloabl.cpp

@@ -0,0 +1,45 @@
+#include "pch.h"
+#include "CBaseGloabl.h"
+
+
+CBaseGloabl::CBaseGloabl()
+{
+
+	 
+	m_Ref = 0;
+
+	m_Networ = new CNetwork();
+}
+
+CBaseGloabl::~CBaseGloabl(void)
+{
+	if (m_Networ)
+	{
+		delete m_Networ;
+		m_Networ = NULL;
+	}
+}
+
+IBaseCurl* CBaseGloabl::GetBaseCurlInstance()
+{
+	return m_Networ;
+}
+
+ 
+INT CBaseGloabl::AddRef()
+{
+	return ++m_Ref;
+}
+
+INT CBaseGloabl::Release()
+{
+	--m_Ref;
+
+	if (m_Ref == 0)
+	{
+		delete this;
+		return 0;
+	}
+
+	return m_Ref;
+}

+ 23 - 0
Base/CBaseGloabl.h

@@ -0,0 +1,23 @@
+#pragma once
+#include "./basecurl/CNetwork.h"
+
+
+
+
+class CBaseGloabl 
+	: public IBaseGloablModule
+{
+public:
+	CBaseGloabl();
+	~CBaseGloabl(void);
+
+	IBaseCurl* GetBaseCurlInstance();
+ 
+
+	INT AddRef();
+	INT Release();
+private:
+	INT m_Ref;
+	CNetwork* m_Networ;
+};
+

+ 180 - 0
Base/CUtils.cpp

@@ -0,0 +1,180 @@
+#include "pch.h"
+#include "CUtils.h"
+
+
+CUtils::CUtils()
+{
+	
+}
+
+CUtils::~CUtils()
+{
+	
+}
+
+
+int CUtils::MultiByToUtf8(const char* multi, char*& utf8)
+{
+	int size = 0;
+	size = MultiByteToWideChar(CP_ACP, NULL, multi, -1, NULL, 0);
+	wchar_t* buff = NULL;
+	buff = (wchar_t*)malloc(sizeof(wchar_t) * (size + 1));
+	if (!buff)
+	{
+		return 0;
+	}
+	wmemset(buff, 0, size + 1);
+	MultiByteToWideChar(CP_ACP, NULL, multi, -1, buff, size);
+	int len = 0;
+	len = WideCharToMultiByte(CP_UTF8, NULL, buff, size, NULL, 0, NULL, NULL);
+	utf8 = NULL;
+	utf8 = (char*)malloc(sizeof(char) * (len + 1));
+	if (!utf8)
+	{
+		free(buff);
+		return 0;
+	}
+	memset(utf8, 0, len + 1);
+	WideCharToMultiByte(CP_UTF8, NULL, buff, size, utf8, len, NULL, NULL);
+	free(buff);
+	return len;
+}
+
+
+int CUtils::Utf8ToMultiBy(const char* utf8, char*& multi)
+{
+	int size = 0;
+	size = MultiByteToWideChar(CP_UTF8, NULL, utf8, -1, NULL, 0);
+	wchar_t* buff = NULL;
+	buff = (wchar_t*)malloc(sizeof(wchar_t) * (size + 1));
+	if (!buff)
+	{
+		return 0;
+	}
+	wmemset(buff, 0, size + 1);
+	MultiByteToWideChar(CP_ACP, NULL, utf8, -1, buff, size);
+	int len = 0;
+	len = WideCharToMultiByte(CP_ACP, NULL, buff, size, NULL, 0, NULL, NULL);
+	multi = NULL;
+	multi = (char*)malloc(sizeof(char) * (len + 1));
+	if (!multi)
+	{
+		free(buff);
+		return 0;
+	}
+	memset(multi, 0, len + 1);
+	WideCharToMultiByte(CP_ACP, NULL, buff, size, multi, len, NULL, NULL);
+	free(buff);
+	return len;
+}
+
+
+//utf8תunicode
+int CUtils::Utf8ToUnicode(const char* utf8, wchar_t*& unicode)
+{
+	int len = 0;
+	len = MultiByteToWideChar(CP_UTF8, NULL, utf8, -1, NULL, 0);
+	unicode = NULL;
+	unicode = (wchar_t*)malloc(sizeof(wchar_t) * (len + 1));
+	if (!unicode)
+	{
+		return 0;
+	}
+	wmemset(unicode, 0, len + 1);
+	MultiByteToWideChar(CP_UTF8, NULL, utf8, -1, unicode, len);
+	return len;
+}
+
+//unicodeתutf8
+int  CUtils::UnicodeToUtf8(const wchar_t* unicode, char*& utf8)
+{
+	int len = 0;
+	len = WideCharToMultiByte(CP_UTF8, NULL, unicode, -1, NULL, 0, NULL, NULL);
+	utf8 = NULL;
+	utf8 = (char*)malloc(sizeof(char) * (len + 1));
+	memset(utf8, 0, len + 1);
+	if (!utf8)
+	{
+		return 0;
+	}
+	WideCharToMultiByte(CP_UTF8, NULL, unicode, -1, utf8, len, NULL, NULL);
+	return len;
+}
+
+//¶à×Ö½Úתunicode
+int  CUtils::MultiByToUnicode(const char* multi, wchar_t*& unicode)
+{
+	int len = 0;
+	len = MultiByteToWideChar(CP_ACP, NULL, multi, -1, NULL, 0);
+	unicode = NULL;
+	unicode = (wchar_t*)malloc(sizeof(wchar_t) * (len + 1));
+	if (!unicode)
+	{
+		return 0;
+	}
+	wmemset(unicode, 0, len + 1);
+	MultiByteToWideChar(CP_ACP, NULL, multi, -1, unicode, len);
+	return len;
+}
+
+//unicodeת¶à×Ö½Ú
+int  CUtils::UnicodeToMultiBy(const wchar_t* unicode, char*& multi)
+{
+	int len = 0;
+	len = WideCharToMultiByte(CP_ACP, NULL, unicode, -1, NULL, 0, NULL, NULL);
+	multi = NULL;
+	multi = (char*)malloc(sizeof(char) * (len + 1));
+	memset(multi, 0, len + 1);
+	if (!multi)
+	{
+		return 0;
+	}
+	WideCharToMultiByte(CP_ACP, NULL, unicode, -1, multi, len, NULL, NULL);
+	return len;
+}
+
+int CUtils::fnmatch_win(const char* pattern, const char* name, int flags)
+{
+	if (SafeFNMatch(pattern, strlen(pattern), name, strlen(name)))
+		return 0;
+	else
+		return FNM_NOMATCH;
+}
+
+/**copy from Google-glog*/
+bool CUtils::SafeFNMatch(const char* pattern, size_t patt_len, const char* str, size_t str_len)
+{
+	size_t p = 0;
+	size_t s = 0;
+	while (1)
+	{
+		if (p == patt_len && s == str_len)
+			return true;
+		if (p == patt_len)
+			return false;
+		if (s == str_len)
+			return p + 1 == patt_len && pattern[p] == '*';
+		if (pattern[p] == str[s] || pattern[p] == '?')
+		{
+			p += 1;
+			s += 1;
+			continue;
+		}
+		if (pattern[p] == '*')
+		{
+			if (p + 1 == patt_len) return true;
+			do
+			{
+				if (SafeFNMatch(pattern + (p + 1), patt_len - (p + 1), str + s, str_len - s))
+				{
+					return true;
+				}
+				s += 1;
+			} while (s != str_len);
+
+			return false;
+		}
+
+		return false;
+	}
+}

BIN
Base/CUtils.h


+ 183 - 0
Base/FileOperate.cpp

@@ -0,0 +1,183 @@
+#include "pch.h"
+#include "FileOperate.h"
+#include <filesystem>
+#include <stdio.h>
+
+FileOperate::FileOperate()
+{}
+
+FileOperate::FileOperate(const std::string &file) : mFile(file)
+{}
+
+FileOperate::~FileOperate()
+{
+	if (mFileStream.is_open()) {
+		close();
+	}
+}
+
+/*
+ * 创建文件
+ */
+bool FileOperate::create(const std::string &file)
+{
+	std::fstream out_file;
+	out_file.open(file.c_str(), std::ios::out);
+	if (!out_file) {
+		return false;
+	}
+	out_file.close();
+
+	return true;
+}
+
+/*
+ * 删除文件
+ */
+bool FileOperate::remove(const std::string &file)
+{
+	// 删除文件,成功返回0,否则返回-1
+	if (-1 == std::remove(file.c_str())) {
+		return false;
+	}
+
+	return true;
+}
+
+bool FileOperate::exist(const string &file)
+{
+	if (std::filesystem::exists(file))
+		return true;
+
+	return false;
+}
+
+bool FileOperate::open(ios_base::openmode __mode)
+{
+	mFileStream.open(mFile.c_str(), __mode);
+
+	return mFileStream.is_open();
+}
+
+bool FileOperate::open(const string &file, ios_base::openmode __mode)
+{
+	mFile = file;
+	return open(__mode);
+}
+
+void FileOperate::close()
+{
+	mFileStream.close();
+	mFileStream.clear();
+}
+
+/*
+ * 文件重命名
+ */
+bool FileOperate::rename(const std::string &newName)
+{
+	std::string newFile = fileDir() + newName;
+
+	int result = std::rename(mFile.c_str(), newFile.c_str());
+	if (result == 0)
+		return true;
+
+	return false;
+}
+
+/*
+ * 判断文件是否存在
+ */
+bool FileOperate::isExist()
+{
+	return FileOperate::exist(mFile);
+}
+
+/*
+ * 获取文件名
+ * 文件绝对路径: /home/root/.../Test/test1.txt
+ * 返回值     : test1.txt
+ */
+const string FileOperate::fileName()
+{
+	string name = mFile;
+
+	std::size_t pos = mFile.rfind('/');
+	if (pos != std::string::npos) {
+		name = mFile.substr(pos + 1);
+	}
+
+	return name;
+}
+
+/*
+ * 获取文件所在目录
+ * 文件绝对路径: /home/root/.../Test/test1.txt
+ * 返回值     : /home/root/.../Test/
+ */
+const string FileOperate::fileDir()
+{
+	string dir = "";
+
+	std::size_t pos = mFile.rfind('/');
+	if (pos != std::string::npos) {
+		dir = mFile.substr(0, pos + 1);
+	}
+
+	return dir;
+}
+
+/*
+ * 获取文件大小(总字节数)
+ */
+size_t FileOperate::fileSize()
+{
+#if 0
+	// 方式一
+	mFileStream.seekg(0, mFileStream.end);
+	int length = mFileStream.tellg();
+	mFileStream.seekg(0, mFileStream.beg);
+
+	return length;
+#endif
+
+	// 方式二
+	struct stat info;
+	stat(mFile.c_str(), &info);
+
+	return static_cast<std::size_t>(info.st_size);
+}
+
+bool FileOperate::atEnd()
+{
+	// peek函数的作用是获取下一个字符,但是指针不会移动
+	return mFileStream.peek() == EOF;
+}
+
+void FileOperate::read(string &buffer, size_t bufferSize)
+{
+	buffer.resize(bufferSize);
+	mFileStream.read(&buffer[0], bufferSize);
+}
+
+const string FileOperate::readLine()
+{
+	// 文件存在 读取数据
+	std::string dataStr = "";
+	getline(mFileStream, dataStr);
+	return dataStr;
+}
+
+const string FileOperate::readAll()
+{
+	std::string buffer;
+	size_t length = fileSize();
+	FileOperate::read(buffer, length);
+
+	return buffer;
+}
+
+void FileOperate::write(const string &data)
+{
+	mFileStream << data << '\n';
+}

+ 126 - 0
Base/FileOperate.h

@@ -0,0 +1,126 @@
+#pragma once
+// FileOperate.h
+#ifndef FILEOPERATE_H
+#define FILEOPERATE_H
+
+#include <iostream>
+#include <string>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fstream>
+ 
+
+using namespace std;
+
+class FileOperate
+{
+public:
+	FileOperate();
+	FileOperate(const std::string& file);
+	~FileOperate();
+
+	// 创建文件
+	static bool create(const std::string &file);
+
+	// 删除文件
+	static bool remove(const std::string &file);
+
+	// 文件是否存在
+	static bool exist(const std::string &file);
+
+	// 打开文件
+	bool open(ios_base::openmode __mode = std::fstream::in | std::fstream::out);
+	bool open(const std::string &file, ios_base::openmode __mode = std::fstream::in | std::fstream::out);
+
+	// 关闭文件
+	void close();
+
+	// 重命名文件
+	bool rename(const std::string &newName);
+
+	// 文件是否存在
+	bool isExist();
+
+	// 获取文件名
+	const std::string fileName();
+
+	// 获取文件所在目录
+	const std::string fileDir();
+
+	// 获取文件大小(总字节数)
+	std::size_t fileSize();
+
+	// 判断当前字符是否在最后
+	bool atEnd();
+
+	// 读取文件内容
+	void read(std::string &buffer, size_t bufferSize);
+	const std::string readLine();
+	const std::string readAll();
+
+	// 写数据到文件
+	void write(const std::string &data);
+
+private:
+	std::string mFile;
+	std::fstream mFileStream;
+};
+
+#endif // FILEOPERATE_H
+
+
+
+/*
+ *
+ // 方式一
+FileOperate mFileOperate("/home/Test/Test1.txt");
+if (!mFileOperate.open(std::fstream::in | std::fstream::out | std::fstream::app)) {
+    cout << "文件打开失败" << endl;
+    return 0;
+}
+
+// 方式二
+FileOperate mFileOperate;
+std::string fileStr = "/home/Test/Test1.txt";
+if (!mFileOperate.open(fileStr, std::fstream::in | std::fstream::out | std::fstream::app)) {
+    cout << "文件打开失败" << endl;
+    return 0;
+}
+
+
+FileOperate mFileOperate("/home/Test/Test1.txt");
+// 获取文件名
+cout << mFileOperate.fileName() << endl;  // 输出: Test1.txt
+
+// 获取文件所在目录
+cout << mFileOperate.fileDir() << endl;   // 输出: /home/xushuan/Test/
+
+// 获取文件大小
+cout << mFileOperate.fileSize() << endl;
+
+
+// 方式一 一行一行读取
+std::string data;
+while (!mFileOperate.atEnd()) {
+	data = mFileOperate.readLine();
+}
+
+// 方式二  读取指定字节大小的数据
+std::string data;
+mFileOperate.read(data, 100);
+
+// 方式三  一次性全部读取
+	// 方式一
+	std::string data = mFileOperate.readAll();
+
+	// 方式二
+	string data;
+	mFileOperate.read(data, mFileOperate.fileSize());
+
+
+	// 写入数据到文件
+mFileOperate.write("hello");
+
+ *
+ *
+ ***/

+ 161 - 0
Base/basecurl/CNetwork.cpp

@@ -0,0 +1,161 @@
+#include "pch.h"
+#include "CNetwork.h"
+#include <nlohmann/json.hpp>
+CNetwork::CNetwork() : m_http_ret(http_no), m_http_status(0)
+{
+	Init();
+}
+
+CNetwork::~CNetwork(void)
+{
+	UnInit();
+}
+
+ 
+
+//void CNetwork::GetServerlist()
+//{
+//	keymap.clear();
+//	std::string path = "v1/nodeproess";
+//	m_http_ret = http_start;
+//	auto data = GetUrl(path, keymap);
+//	if (data.empty())
+//	{
+//		m_http_ret = http_f;
+//		m_error_msg = "";
+//		m_error_msg.append("请求错误:网络问题,错误码:").append(std::to_string(m_http_status));
+//		return;
+//	}
+//	//解析数据
+//	/*if (!m_server_list)
+//	{
+//		m_error_msg = "server_list为空";
+//		return;
+//	}
+//
+//
+//	if (!m_server_list->parse(data))
+//	{
+//		m_error_msg = m_server_list->GetLastErrorA();
+//		m_http_ret = http_f;
+//		return;
+//	}*/
+//
+//
+//	m_http_ret = http_end;
+//}
+
+ 
+
+ 
+
+void CNetwork::Init() {
+
+ 
+}
+
+void CNetwork::UnInit()
+{
+	/*if (m_server_list)
+	{
+		delete m_server_list;
+		m_server_list = NULL;
+	}
+
+	if (m_userinfo)
+	{
+		delete m_userinfo;
+		m_userinfo = NULL;
+	}*/
+}
+
+ 
+ 
+HTTPRET CNetwork::GetHttpConnectstatus()
+{
+	return m_http_ret;
+}
+
+LPCSTR CNetwork::GetLastErrorA()
+{
+	return m_error_msg.c_str();
+}
+
+ 
+
+std::string CNetwork::GetUrl(std::string path,std::unordered_map<std::string, std::string> parame)
+{
+	 
+
+
+	cpr::Parameters p;
+	for (auto it = parame.begin(); it != parame.end(); ++it) {
+		//auto s = fmt::format("{0}", it->first);
+		/*p.AddParameter({ it->first, it->second }, {});*/
+	}
+
+	for (auto it = vectorBaseurl.begin(); it != vectorBaseurl.end(); ++it) {
+		auto s = fmt::format("{0}/{1}", *it, path.c_str());
+		
+		cpr::Response r;
+
+		if (parame.empty())
+		{
+			r = cpr::Get(cpr::Url{ s.c_str() });
+		}
+		else {
+			r = cpr::Get(cpr::Url{ s.c_str() }, p,cpr::Header{ {"accept", "application/json"} });
+		}
+		
+		if (r.status_code == 200 || r.status_code == 201)
+		{
+			return r.text;
+		}
+		else {
+			m_http_status = r.status_code;
+			return "";
+		}
+
+	}
+
+	
+
+	return std::string("");
+}
+
+std::string CNetwork::PostUrl(std::string path,std::unordered_map<std::string, std::string> parame, std::string data)
+{
+	std::vector<cpr::Pair> p;
+	for (auto it = parame.begin(); it != parame.end(); ++it) {
+		//auto s = fmt::format("{0}", it->first);
+		//p.AddPair(cpr::Pair{ it->first,it->second }, {});
+		p.push_back({ it->first,it->second });
+
+	}
+
+	for (auto it = vectorBaseurl.begin(); it != vectorBaseurl.end(); ++it) {
+		auto s = fmt::format("{0}/{1}", *it, path.c_str());
+
+		cpr::Response r;
+
+		if (parame.empty())
+		{
+			r = cpr::Get(cpr::Url{ s.c_str() });
+		}
+		else {
+			r = cpr::Post(cpr::Url{ s.c_str() }, cpr::Payload{ p.begin(),p.end() }, cpr::Header{ {"accept", "application/json"} });
+		}
+
+		if (r.status_code == 200 || r.status_code == 201)
+		{
+			return std::move(r.text);
+		}
+		else {
+			m_http_status = r.status_code;
+			return "";
+		}
+
+	}
+	return std::string("");
+}
+

+ 33 - 0
Base/basecurl/CNetwork.h

@@ -0,0 +1,33 @@
+#pragma once
+
+class CNetwork : public IBaseCurl
+{
+public:
+	CNetwork();
+	~CNetwork(void);
+
+ 
+
+	HTTPRET GetHttpConnectstatus();
+	LPCSTR  GetLastErrorA();
+ 
+
+private:
+	std::string GetUrl(std::string path,std::unordered_map<std::string, std::string> parame);
+	std::string PostUrl(std::string path,std::unordered_map<std::string, std::string> parame, std::string data);
+	void Init();
+	void UnInit();
+private:
+
+	std::vector<std::string> vectorBaseurl;
+
+	std::unordered_map<std::string, std::string> keymap;
+
+	std::string m_error_msg;
+
+	HTTPRET m_http_ret;
+
+	int m_http_status;
+
+};
+

+ 84 - 0
Base/framework.h

@@ -0,0 +1,84 @@
+#pragma once
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__293E641A_6D1B_4F78_AAC3_BF2253E98922__INCLUDED_)
+#define AFX_STDAFX_H__293E641A_6D1B_4F78_AAC3_BF2253E98922__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#ifndef _SECURE_ATL
+#define _SECURE_ATL 1
+#endif
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN		// 从 Windows 头中排除极少使用的资料
+#endif
+
+// 如果您必须使用下列所指定的平台之前的平台,则修改下面的定义。
+// 有关不同平台的相应值的最新信息,请参考 MSDN。
+#ifndef WINVER				// 允许使用特定于 Windows XP 或更高版本的功能。
+#define WINVER 0x0501		// 将此值更改为相应的值,以适用于 Windows 的其他版本。
+#endif
+
+#ifndef _WIN32_WINNT		// 允许使用特定于 Windows XP 或更高版本的功能。
+#define _WIN32_WINNT 0x0501	// 将此值更改为相应的值,以适用于 Windows 的其他版本。
+#endif						
+
+#ifndef _WIN32_WINDOWS		// 允许使用特定于 Windows 98 或更高版本的功能。
+#define _WIN32_WINDOWS 0x0410 // 将它更改为适合 Windows Me 或更高版本的相应值。
+#endif
+
+#ifndef _WIN32_IE			// 允许使用特定于 IE 6.0 或更高版本的功能。
+#define _WIN32_IE 0x0600	// 将此值更改为相应的值,以适用于 IE 的其他版本。值。
+#endif
+
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// 某些 CString 构造函数将是显式的
+
+
+
+#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
+#pragma warning(disable:4996)
+#define _CRT_SECURE_NO_WARNINGS
+
+
+#define WIN32_LEAN_AND_MEAN		// 从 Windows 头中排除极少使用的资料
+#define _WIN32_DCOM
+//#define _CRTDBG_MAP_ALLOC
+#include <stdlib.h>
+#include <crtdbg.h>
+#include <atlstr.h>
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include <tchar.h>
+#include <winsock2.h>
+#include "../__INCLUDE/BaseModule.h"
+#include <functional>
+#include <string>
+#include <regex>
+#include <vector>
+#include <locale>
+#include <string_view>
+#include <codecvt>
+#include <cpr/api.h>
+#include <fmt/ostream.h>
+#include <locale>
+#include <codecvt>
+#include<memory>
+#include <algorithm>
+
+#define ASSERT ATLASSERT
+#define TRACE ATLTRACE
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__293E641A_6D1B_4F78_AAC3_BF2253E98922__INCLUDED_)
+

+ 5 - 0
Base/pch.cpp

@@ -0,0 +1,5 @@
+// pch.cpp: 与预编译标头对应的源文件
+
+#include "pch.h"
+
+// 当使用预编译的头时,需要使用此源文件,编译才能成功。

+ 13 - 0
Base/pch.h

@@ -0,0 +1,13 @@
+// pch.h: 这是预编译标头文件。
+// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
+// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
+// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
+// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
+
+#ifndef PCH_H
+#define PCH_H
+
+// 添加要在此处预编译的标头
+#include "framework.h"
+
+#endif //PCH_H

+ 10 - 0
SProxy.sln

@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.32228.343
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SProxy", "SProxy\SProxy.vcxproj", "{9B4F9A09-C54F-4BF1-BDA5-F2A2B527CD51}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Base", "Base\Base.vcxproj", "{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x64 = Debug|x64
@@ -21,6 +23,14 @@ Global
 		{9B4F9A09-C54F-4BF1-BDA5-F2A2B527CD51}.Release|x64.Build.0 = Release|x64
 		{9B4F9A09-C54F-4BF1-BDA5-F2A2B527CD51}.Release|x86.ActiveCfg = Release|Win32
 		{9B4F9A09-C54F-4BF1-BDA5-F2A2B527CD51}.Release|x86.Build.0 = Release|Win32
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Debug|x64.ActiveCfg = Debug|x64
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Debug|x64.Build.0 = Debug|x64
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Debug|x86.ActiveCfg = Debug|Win32
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Debug|x86.Build.0 = Debug|Win32
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Release|x64.ActiveCfg = Release|x64
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Release|x64.Build.0 = Release|x64
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Release|x86.ActiveCfg = Release|Win32
+		{9CD7F2E8-8644-4DE2-96DC-2E86A89E4369}.Release|x86.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

BIN
SProxy/SProxy.cpp


+ 12 - 4
SProxy/SProxy.vcxproj

@@ -78,13 +78,13 @@
     <LinkIncremental>false</LinkIncremental>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IntDir>$(Configuration)64\</IntDir>
-    <OutDir>$(SolutionDir)$(Configuration)64\</OutDir>
+    <IntDir>..\__obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+    <OutDir>..\__bin\$(Platform)\$(Configuration)\</OutDir>
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IntDir>$(Configuration)64\</IntDir>
-    <OutDir>$(SolutionDir)$(Configuration)64\</OutDir>
+    <IntDir>..\__obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+    <OutDir>..\__bin\$(Platform)\$(Configuration)\</OutDir>
     <LinkIncremental>false</LinkIncremental>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -146,6 +146,7 @@
       <BrowseInformation>true</BrowseInformation>
       <Optimization>Disabled</Optimization>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <LanguageStandard>stdcpp17</LanguageStandard>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -169,6 +170,7 @@
       <PreprocessorDefinitions>WIN64;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <WholeProgramOptimization>true</WholeProgramOptimization>
+      <LanguageStandard>stdcpp17</LanguageStandard>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -186,9 +188,12 @@
     <Text Include="readme.txt" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="LoginDlg.cpp" />
     <ClCompile Include="MainDlg.cpp" />
     <ClCompile Include="SouiInit.cpp" />
     <ClCompile Include="SProxy.cpp" />
+    <ClCompile Include="SRadioBox2.cpp" />
+    <ClCompile Include="StabtypeControl.cpp" />
     <ClCompile Include="stdafx.cpp">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@@ -200,9 +205,12 @@
     <ResourceCompile Include="SProxy.rc" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="LoginDlg.h" />
     <ClInclude Include="MainDlg.h" />
     <ClInclude Include="resource.h" />
     <ClInclude Include="SouiInit.h" />
+    <ClInclude Include="SRadioBox2.h" />
+    <ClInclude Include="StabtypeControl.h" />
     <ClInclude Include="stdafx.h" />
   </ItemGroup>
   <ItemGroup>

+ 18 - 0
SProxy/SProxy.vcxproj.filters

@@ -35,6 +35,15 @@
     <ClCompile Include="SouiInit.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="SRadioBox2.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="StabtypeControl.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="LoginDlg.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="SProxy.rc">
@@ -54,6 +63,15 @@
     <ClInclude Include="SouiInit.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="SRadioBox2.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="StabtypeControl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="LoginDlg.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="res\soui_res.rc2">

+ 37 - 0
SProxy/SRadioBox2.cpp

@@ -0,0 +1,37 @@
+#include "stdafx.h"
+#include "SRadioBox2.h"
+
+namespace SOUI
+{
+    SRadioBox2::SRadioBox2(void):m_pIcon(NULL),m_nTextOffset(0)
+    {
+    }
+
+    SRadioBox2::~SRadioBox2(void)
+    {
+    }
+
+    void SRadioBox2::OnPaint(IRenderTarget *pRT)
+    {
+        if(m_pSkin)
+        {
+            CRect rc;
+            GetClientRect(&rc);
+            int nState = 0;
+            if(GetState() & WndState_Check) nState = 2;
+            else if(GetState() & WndState_PushDown) nState = 2;
+            else if(GetState() & WndState_Hover) nState = 1;
+            
+            m_pSkin->Draw(pRT,rc,nState);
+        }
+        if(m_pIcon)
+        {
+            CRect rcIcon=GetClientRect();
+            rcIcon.OffsetRect(m_ptIcon);
+            rcIcon=CRect(rcIcon.TopLeft(),m_pIcon->GetSkinSize());
+            m_pIcon->Draw(pRT,rcIcon,IIF_STATE3(GetState(),0,1,2));
+        }
+        SWindow::OnPaint(pRT);
+    }
+
+}

+ 47 - 0
SProxy/SRadioBox2.h

@@ -0,0 +1,47 @@
+#pragma once
+
+#include <control/SCmnCtrl.h>
+
+namespace SOUI
+{
+    class SRadioBox2 : public SRadioBox
+    {
+    SOUI_CLASS_NAME(SRadioBox2,L"radio2")
+    public:
+        SRadioBox2(void);
+        ~SRadioBox2(void);
+        
+    protected:
+        virtual CSize GetDesiredSize(LPCRECT pRcContainer)
+        {
+            if(m_pSkin) return m_pSkin->GetSkinSize();
+            else return SWindow::GetDesiredSize(pRcContainer);
+        }
+        virtual void GetTextRect(LPRECT pRect)
+        {
+            SWindow::GetTextRect(pRect);
+            pRect->left+=m_nTextOffset;
+        }
+        virtual void DrawFocus(IRenderTarget *pRT)
+        {
+        }
+
+    protected:       
+        void OnPaint(IRenderTarget *pRT);
+
+        SOUI_MSG_MAP_BEGIN()
+            MSG_WM_PAINT_EX(OnPaint)
+        SOUI_MSG_MAP_END()
+
+        ISkinObj *  m_pIcon;
+        CPoint      m_ptIcon;
+        int         m_nTextOffset;
+        SOUI_ATTRS_BEGIN() 
+            ATTR_SKIN(L"iconSkin",m_pIcon,TRUE)
+            ATTR_POINT(L"iconPos",m_ptIcon,TRUE)
+            ATTR_INT(L"textOffset",m_nTextOffset,TRUE)
+        SOUI_ATTRS_END()
+
+    };
+
+}

+ 4 - 0
SProxy/SouiInit.cpp

@@ -1,5 +1,7 @@
 #include "stdafx.h"
 #include "SouiInit.h"
+#include "SRadioBox2.h"
+#include "StabtypeControl.h"
  
 //从PE文件加载,注意从文件加载路径位置
 #define RES_TYPE 0
@@ -110,6 +112,8 @@ void InitUserRes(SApplication * theApp, SComMgr *pComMgr)
 void SUserObjectDefaultRegister::RegisterWindows(SObjectFactoryMgr * objFactory) const
 {	
 #define RegWnd(wndClass) objFactory->TplRegisterFactory<wndClass>();
+	RegWnd(SRadioBox2)
+	RegWnd(StabtypeControl)
 	//RegWnd(SBrowserTabCtrl)	
 	//RegWnd(CDropWnd)
 	//RegWnd(SRelTabCtrl)

+ 138 - 0
SProxy/StabtypeControl.cpp

@@ -0,0 +1,138 @@
+#include "stdafx.h"
+#include "StabtypeControl.h"
+#include "SRadioBox2.h"
+
+
+namespace SOUI
+{
+	StabtypeControl::StabtypeControl()
+	{
+		m_evtSet.addEvent(EVENTID(EventTabtypeControl));
+	}
+
+
+	StabtypeControl::~StabtypeControl()
+	{
+	}
+
+	void StabtypeControl::DestroyWindowcon()
+	{
+		SOUI::SWindow * wins = FindChildByName2<SOUI::SWindow>(L"con");
+		if (wins)
+		{
+			//remove all children at first.
+			SWindow *pChild = wins->GetWindow(GSW_FIRSTCHILD);
+			while (pChild)
+			{
+				SWindow *pNext = pChild->GetWindow(GSW_NEXTSIBLING);
+				pChild->DestroyWindow();
+				pChild = pNext;
+			}
+
+		}
+	}
+
+	void StabtypeControl::ItemCreateChildren(int id, SStringW title,bool checked)
+	{
+
+	
+
+		
+		SOUI::SWindow * win = FindChildByName2<SOUI::SWindow>(L"con");
+		if (win)
+		{
+			//font=\"face:微软雅黑, size : 16\"
+			SOUI::SStringW strXmlName;
+			if (checked)
+			{
+				//<radio2 size="0,-1" name="" colorTextPush="#D8D8D8" colorText="#D8D8D844" font="adding:12,bold:1" checked="1" skin="skin_tyteselection" align="center" weight="1" extend="0,0,0,0" >US</radio2>
+				strXmlName.Format(L"<radio2 id=\"%d\" \
+				size=\"0, -1\" \
+				cursor=\"hand\" \
+			    colorText=\"#D8D8D844\"\
+				colorTextPush=\"#D8D8D8\"\
+				font=\"adding:12,bold:1\"\
+				align=\"center\"\
+				cursor=\"hand\"\
+				extend=\"0,0,0,0\" \
+				tip=\"%s\" \
+				animate=\"1\" \
+				skin=\"skin_tyteselection\" \
+				name=\"%d\" \
+				weight=\"1\"\
+				checked=\"1\"> \
+				%s</radio2>", id, title, id, title);
+			}
+			else
+			{
+				strXmlName.Format(L"<radio2 id=\"%d\" \
+				size=\"0, -1\" \
+				cursor=\"hand\" \
+			    colorText=\"#D8D8D844\"\
+				colorTextPush=\"#D8D8D8\"\
+				font=\"adding:12,bold:1\"\
+				align=\"center\"\
+				cursor=\"hand\"\
+				extend=\"5,0,0,0\" \
+				tip=\"%s\" \
+				animate=\"1\" \
+				skin=\"skin_tyteselection\" \
+				name=\"%d\" \
+				weight=\"1\"\
+				checked=\"0\"> \
+				%s</radio2>", id, title, id, title);
+			}
+
+			win->CreateChildren(strXmlName);
+
+
+
+
+			SOUI::SStringW strbutto;
+			strbutto.Format(L"%d", id);
+			SOUI::SRadioBox2* pButton =
+				FindChildByName2<SOUI::SRadioBox2>(strbutto);
+			pButton->GetEventSet()->subscribeEvent(SOUI::EVT_CMD,
+				Subscriber(&StabtypeControl::OnBtnClick, this));
+		}
+
+	}
+
+
+	// 创建控件:初始化 xml,绑定事件等等
+	int StabtypeControl::OnCreate(LPCREATESTRUCT lpCreateStruct)
+	{
+		pugi::xml_document xmlDoc;
+		SOUI::SStringW strXml = L"tabtype_control";
+
+		if (!LOADXML(xmlDoc, strXml, L"LAYOUT")) {
+			return E_FAIL;
+		}
+		pugi::xml_node itemXmlNode = xmlDoc.child(L"tabtypecontrol");
+		if (!itemXmlNode) {
+			return E_FAIL;
+		}
+		this->CreateChildren(itemXmlNode);
+		
+		return 0;
+	}
+
+
+	// 按钮点击响应
+	bool StabtypeControl::OnBtnClick(SOUI::EventArgs* pEvt)
+	{
+		// 获取按钮名称,获取后缀数字
+		SOUI::SWindow* pButton =
+			SOUI::sobj_cast<SOUI::SWindow>(pEvt->sender);
+		SOUI::SStringW strName = pButton->GetName();
+		//SOUI::SStringW strIndex = strName.Right(1);
+		INT nIndex = _wtoi(strName);
+
+		// 发送全局的自定义消息
+		EventTabtypeControl evt(this);
+		evt.nIndex = nIndex;
+		FireEvent(evt);	// 激活事件 Fire!!!
+		return true;
+	}
+
+}

+ 53 - 0
SProxy/StabtypeControl.h

@@ -0,0 +1,53 @@
+#pragma once
+
+namespace SOUI
+{
+
+#define EVT_TABTYPE_CONTROL (SOUI::EVT_EXTERNAL_BEGIN + 400)
+
+	class EventTabtypeControl : public TplEventArgs<EventTabtypeControl>
+	{
+		SOUI_CLASS_NAME(EventTabtypeControl, L"on_tabtype_constrol")
+	public:
+		EventTabtypeControl(SOUI::SWindow* pSender) : TplEventArgs<EventTabtypeControl>(pSender)
+		{
+
+		}
+		enum { EventID = EVT_TABTYPE_CONTROL };
+
+		INT nIndex;
+	};
+
+
+	class StabtypeControl : public SWindow
+	{
+
+		SOUI_CLASS_NAME(StabtypeControl, L"tabtypecontrol")
+
+	public:
+		StabtypeControl();
+		virtual ~StabtypeControl();
+		void DestroyWindowcon();
+
+		void ItemCreateChildren(int id, SStringW title, bool checked);
+
+	protected:
+		// 创建控件:初始化 xml,绑定事件等等
+		int OnCreate(LPCREATESTRUCT lpCreateStruct);
+
+		
+ 
+		// 处理控件 xml 属性
+		SOUI_ATTRS_BEGIN()
+			SOUI_ATTRS_END()
+
+			// 响应控件窗口消息
+			SOUI_MSG_MAP_BEGIN()
+			MSG_WM_CREATE(OnCreate)
+			SOUI_MSG_MAP_END()
+	private:
+		bool OnBtnClick(SOUI::EventArgs* pEvt);
+
+	};
+
+}

BIN
SProxy/res/resource.h


BIN
SProxy/res/soui_res.rc2


BIN
SProxy/uires/image/bg-home.png


BIN
SProxy/uires/image/bg-login.png


BIN
SProxy/uires/image/bg-user.png


BIN
SProxy/uires/image/btn-back.png


BIN
SProxy/uires/image/soui.ico


BIN
SProxy/uires/image/tyte_selection.png


+ 23 - 19
SProxy/uires/uires.idx

@@ -1,20 +1,24 @@
-<resource>
-  <UIDEF>
-    <file name="XML_INIT" path="uidef\init.xml"/>
-  </UIDEF>
-  <LAYOUT>
-    <file name="XML_MAINWND" path="xml\dlg_main.xml"/>
-  </LAYOUT>
-  
-  <values>
-  	<file name="string" path="values\string.xml"/>
-  	<file name="color" path="values\color.xml"/>
-  	<file name="skin" path="values\skin.xml"/>
-  </values>
-
-  <IMG>
+<?xml version="1.0"?>
+<resource>
+	<UIDEF>
+		<file name="XML_INIT" path="uidef\init.xml" />
+	</UIDEF>
+	<LAYOUT>
+		<file name="XML_MAINWND" path="xml\dlg_main.xml" />
+    <file name="XML_LOGIN" path="xml\dlg_login.xml" />
+	</LAYOUT>
+	<values>
+		<file name="string" path="values\string.xml" />
+		<file name="color" path="values\color.xml" />
+		<file name="skin" path="values\skin.xml" />
+	</values>
+	<IMG>
+  	<file name="bg-login_png" path="image\bg-login.png" />
+  	<file name="bg-home_png" path="image\bg-home.png" />
+  	<file name="bg-user_png" path="image\bg-user.png" />
   </IMG>
-  <ICON>
-    <file name="ICON_LOGO"  path="image\soui.ico"/>
-  </ICON>
-</resource>
+	<ICON>
+		<file name="ICON_LOGO" path="image\soui.ico" />
+	</ICON>
+ 
+</resource>

+ 6 - 4
SProxy/uires/values/skin.xml

@@ -1,5 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-
+<?xml version="1.0" encoding="utf-8"?>
 <skin>
-  	<imglist name="skin_traymenu_icons"	src="img:traymenu_icons" states="9"/>
-	</skin>
+	<imglist name="skin_traymenu_icons" src="img:traymenu_icons" states="9" />
+	<imglist name="bg-login_png" src="img:bg-login_png"/>
+	<imglist name="bg-home_png" src="img:bg-home_png"/>
+	<imglist name="bg-user_png" src="img:bg-user_png"/>
+</skin>

+ 2 - 2
SProxy/uires/xml/dlg_main.xml

@@ -1,7 +1,7 @@
-<SOUI name="mainWindow" title="@string/title" bigIcon="ICON_LOGO:32" smallIcon="ICON_LOGO:16" width="600" height="400"  margin="5,5,5,5"  resizable="1" wndType="appMain"
+<SOUI name="loginwindow" title="@string/title" bigIcon="ICON_LOGO:32" smallIcon="ICON_LOGO:16"  width="414" height="736" margin="5,5,5,5"  resizable="1" wndType="appMain"
 appWnd="1"
 >
-  <root skin="_skin.sys.wnd.bkgnd" cache="1">
+  <root skin="bg-home_png" cache="1">
     <caption pos="0,0,-0,30" show="1" font="adding:0">
       <text pos="29,9">@string/title</text>
       <imgbtn name="btn_close" skin="_skin.sys.btn.close"    pos="-45,0" tip="close" animate="1"/>

+ 184 - 0
__INCLUDE/BaseModule.h

@@ -0,0 +1,184 @@
+#pragma once
+#ifndef _BASEMODULE_
+#define _BASEMODULE_
+
+#ifndef BASEMODULE
+#define BASEMODULE extern "C" _declspec(dllexport)
+#else
+#undef BASEMODULE
+#define BASEMODULE extern "C" _declspec(dllimport)
+#endif
+
+#define CLSID_BASEMODULE L"{DA90D68D-99EB-45D5-A969-BC3D0D12D92A}"
+
+#pragma pack(push,1)
+
+class IBaseCurl;
+class IServerList;
+class IUserinfo;
+//获取其他类的指针
+class IBaseGloablModule
+{
+public:
+	virtual ~IBaseGloablModule(void) {}
+
+	////获取错误的消息
+	//virtual LPCSTR  GetLastErrorA() = 0;
+	//virtual LPCWSTR GetLastErrorW() = 0;
+
+	virtual IBaseCurl* GetBaseCurlInstance() = 0;
+ 
+
+	virtual INT AddRef() = 0;
+	virtual INT Release() = 0;
+};
+
+template<typename T>
+class IInstanceList
+{
+public:
+	IInstanceList(void)
+	{
+		m_pNext = NULL;
+		m_pPrev = NULL;
+	}
+	virtual ~IInstanceList(void)
+	{
+		Detach();
+	}
+
+	virtual void AddInstance(T* pInstance)
+	{
+		if (m_pNext && (m_pNext != pInstance))
+			m_pNext->AddInstance(pInstance);
+		else
+		{
+			pInstance->m_pPrev = (T*)this;
+			m_pNext = pInstance;
+		}
+	}
+
+	virtual void Detach()
+	{
+		if (m_pNext)
+			m_pNext->m_pPrev = m_pPrev;
+		if (m_pPrev)
+			m_pPrev->m_pNext = m_pNext;
+
+		m_pPrev = m_pNext = NULL;
+	}
+
+	T* m_pPrev;
+	T* m_pNext;
+};
+
+struct SPROXY_NET
+{
+	int  sid;
+	int  groupid;
+	char addproxy[64];
+	char username[64];
+	char password[64];
+	char processname[64];
+	char title[64];
+	int  port;
+	int  status;
+	int  id;
+	int  pid;
+	int  isros;
+	int  proxy_type;
+	bool select;
+	int  count;
+	int  mid;	//模拟器ID
+
+	 //查找结构体e是否存在
+	bool operator == (const SPROXY_NET& e) {
+		return (this->id == e.id);
+	}
+
+	//查找数值
+	bool operator == (const int& id) {
+		return (this->id == id);
+	}
+};
+
+struct PROESSSHOW
+{
+	char title[64];
+	int  pid;
+};
+
+struct ProcessInfo
+{
+	int		id;
+	wchar_t gnmae[256];
+	wchar_t proceessname[256];
+	int		select;
+};
+
+struct USERINFO
+{
+	char username[64];
+	char password[64];
+	char expiretime[64];
+	int	id;
+	int number;
+	int alreadycount;
+};
+
+/**
+服务器组
+*/
+struct ServerGroup
+{
+	int id;
+	char title[64];
+};
+
+class IServerListCallback
+{
+public:
+	virtual ~IServerListCallback(void) {};
+
+	virtual void ServerListCallback() = 0;
+};
+
+class IServerList
+	: public IInstanceList<IServerList>
+{
+public:
+	virtual ~IServerList(void) {};
+};
+
+class IUserinfo
+	: public IInstanceList<IUserinfo>
+{
+public:
+	virtual ~IUserinfo(void) {};
+};
+
+enum HTTPRET
+{
+	http_no = 0,
+	http_f,
+	http_yes,
+	http_start,
+	http_end,
+};
+//请求网络接口
+class IBaseCurl
+	: public IInstanceList<IBaseCurl>
+{
+public:
+	virtual ~IBaseCurl(void) {};
+	virtual HTTPRET GetHttpConnectstatus() = 0;
+
+	virtual LPCSTR  GetLastErrorA() = 0;
+};
+
+BASEMODULE IBaseGloablModule* WINAPI GetBaseGlobalInstance();
+BASEMODULE BOOL WINAPI ReleaseBaseGlobalInstance();
+
+#pragma pack(pop)
+
+#endif

+ 243 - 0
__INCLUDE/LvAdapterHandle.hpp

@@ -0,0 +1,243 @@
+/*
+SListView 的数据适配器
+扩展了 SAdapterBase  
+自己处理 ItemClick 等 5个 事件 且 设置了 bubbleup 不让 其他调用
+这样就可以 点击 item里的按钮 而不会导致整个item 选中 
+*/
+
+#pragma once 
+#include <helper/SAdapterBase.h>
+
+
+// SListView 数据适配器 封装
+class LvAdapterHandle : public SAdapterBase
+{
+public:
+	LvAdapterHandle(SListView*	pOwner)
+		: m_pOwner(pOwner)
+		, m_evtSlot_ItemClick(&LvAdapterHandle::OnEventItemClick, this)
+		, m_evtSlot_ItemDbClick(&LvAdapterHandle::OnEventItemDbClick, this)
+		, m_evtSlot_ItemRClick(&LvAdapterHandle::OnEventItemRClick, this)
+		, m_evtSlot_ItemHover(&LvAdapterHandle::OnEventItemHover, this)
+		, m_evtSlot_ItemLeave(&LvAdapterHandle::OnEventItemLeave, this)
+	{
+		 
+		if(NULL != m_pOwner)
+		{
+			m_pOwner->GetEventSet()->subscribeEvent(&LvAdapterHandle::OnEventLvSelChangeing, this);
+		}
+	}
+
+    virtual ~LvAdapterHandle()
+	{
+	
+	}
+	
+	void SelectItem(int nItem, bool bNotify=false)
+	{
+		m_pOwner->SetSel(nItem, bNotify ? TRUE : FALSE);
+	}
+	int GetSelectItem()
+	{
+		return m_pOwner->GetSel();
+	}
+protected:
+	// 这个用来 显示 数据  在 getView 里 调用 这里去掉了  模版加载  
+	virtual void ShowView(int nItem, SWindow* pItem)
+	{
+
+	}
+	// item click 回调 可以
+	virtual void ItemClick(int nItem, SItemPanel* pItem, const CPoint& pt)
+	{
+
+	}
+	// 
+	virtual void ItemDbClick(int nItem, SItemPanel* pItem, const CPoint& pt)
+	{
+
+	}
+	virtual void ItemRClick(int nItem, SItemPanel* pItem, const CPoint& pt)
+	{
+
+	}
+	virtual void ItemHover(int nItem, SItemPanel* pItem, const CPoint& pt)
+	{
+
+	}
+	virtual void ItemLeave(int nItem, SItemPanel* pItem)
+	{
+
+	}
+	// 判断 是否 点击item 用来 item 里 有按钮等  控件 判断
+	virtual bool IsItemClick(int nItem, const SStringT& szSndName)
+	{
+		return true;
+	}
+protected:    
+	virtual void InitByTemplate(pugi::xml_node xmlTemplate)
+	{
+		//auto ite = xmlTemplate.attribute(L"colorSelected");
+		//m_szSelectColor = ite.as_string();
+		//ite = L"#FFFFFF00";			// 设置成 透明 的  
+	}
+	      
+	//virtual SIZE getViewDesiredSize(int position, SOUI::SWindow *pItem, LPCRECT prcContainer)
+	//{
+
+	//}
+	/*virtual int getItemViewType(int position)
+	{
+
+	}*/
+	//virtual SStringT GetColumnName(int iCol) const
+	//{
+	//	return L"col_nick";
+	//}
+	virtual void getView(int nPosition, SWindow* pItem, pugi::xml_node xmlTemplate)
+	{		
+		if(0 == pItem->GetChildrenCount())
+		{
+			pItem->InitFromXml(xmlTemplate);
+
+			auto eventItem = pItem->GetEventSet();
+			eventItem->subscribeEvent(EventItemPanelClick::EventID, m_evtSlot_ItemClick);
+			eventItem->subscribeEvent(EventItemPanelDbclick::EventID, m_evtSlot_ItemDbClick);
+			eventItem->subscribeEvent(EventItemPanelRclick::EventID, m_evtSlot_ItemRClick);
+			eventItem->subscribeEvent(EventItemPanelHover::EventID, m_evtSlot_ItemHover);
+			eventItem->subscribeEvent(EventItemPanelLeave::EventID, m_evtSlot_ItemLeave);
+		}
+
+		
+		
+		
+
+		ShowView(nPosition, pItem);
+	}
+	bool OnEventLvSelChangeing(EventLVSelChanging* pEvt)
+	{
+		if(NULL == pEvt)
+			return true;
+		
+		pEvt->bubbleUp = false;
+
+		if(-1 == pEvt->iNewSel)				// 不能设置 -1 
+			pEvt->bCancel = TRUE;
+
+		return true;
+	}
+	bool OnEventItemClick(EventArgs* e)
+	{
+		EventItemPanelClick* pEvt = sobj_cast<EventItemPanelClick>(e);
+		if(NULL == pEvt) return true;
+
+		SItemPanel* pItem = sobj_cast<SItemPanel>(pEvt->sender);
+		if(NULL == pItem) return true;
+			
+		int nItem = static_cast<int>(pItem->GetItemIndex());
+
+		CPoint pt;
+		pt.x = GET_X_LPARAM(pEvt->lParam);
+		pt.y = GET_Y_LPARAM(pEvt->lParam);
+		
+		// 判断 点击 的 是否是  删除按钮
+		SWND hHover = pItem->SwndFromPoint(pt, FALSE);
+		SWindow* pChild = SWindowMgr::GetWindow(hHover);
+	
+		if(NULL != pChild)			// 如果 有 消息 就 不选中
+		{
+			if(!IsItemClick(nItem, pChild->GetName())	)
+			{
+				e->bubbleUp = false; // 设置了   点击事件 只在 这里处理 SListView 不处理 
+				return true;
+			}
+		}
+		
+		ItemClick(nItem, pItem, pt);
+				
+		return true;
+
+	}
+	
+	bool OnEventItemDbClick(EventArgs* e)
+	{
+		EventItemPanelDbclick* pEvt = sobj_cast<EventItemPanelDbclick>(e);
+		if(NULL == pEvt) return true;
+
+		SItemPanel* pItem = sobj_cast<SItemPanel>(pEvt->sender);
+		if(NULL == pItem) return true;
+
+		int nItem = static_cast<int>(pItem->GetItemIndex());
+
+		CPoint pt;
+		pt.x = GET_X_LPARAM(pEvt->lParam);
+		pt.y = GET_Y_LPARAM(pEvt->lParam);
+
+		ItemDbClick(nItem, pItem, pt);
+
+		return true;
+	}
+	bool OnEventItemRClick(EventArgs* e)
+	{
+		EventItemPanelRclick* pEvt = sobj_cast<EventItemPanelRclick>(e);
+		if(NULL == pEvt) return true;
+
+		SItemPanel* pItem = sobj_cast<SItemPanel>(pEvt->sender);
+		if(NULL == pItem) return true;
+
+		int nItem = static_cast<int>(pItem->GetItemIndex());
+		
+		CPoint pt;
+		pt.x = GET_X_LPARAM(pEvt->lParam);
+		pt.y = GET_Y_LPARAM(pEvt->lParam);
+
+		ItemRClick(nItem, pItem, pt);
+
+		return true;
+	}
+
+	bool OnEventItemHover(EventArgs* e)
+	{
+		EventItemPanelHover* pEvt = sobj_cast<EventItemPanelHover>(e);
+		if(NULL == pEvt)
+			return true;
+		
+		SItemPanel* pItem = sobj_cast<SItemPanel>(pEvt->sender);
+		if(NULL == pItem) return true;
+
+		int nItem = static_cast<int>(pItem->GetItemIndex());
+
+		CPoint pt;
+		pt.x = GET_X_LPARAM(pEvt->lParam);
+		pt.y = GET_Y_LPARAM(pEvt->lParam);
+
+		ItemHover(nItem, pItem, pt);
+
+		return true;
+	}
+
+	bool OnEventItemLeave(EventArgs* e)
+	{
+		EventItemPanelLeave* pEvt = sobj_cast<EventItemPanelLeave>(e);
+		if(NULL == pEvt)
+			return true;
+		
+		SItemPanel* pItem = sobj_cast<SItemPanel>(pEvt->sender);
+		if(NULL == pItem) return true;
+
+		int nItem = static_cast<int>(pItem->GetItemIndex());
+		
+		ItemLeave(nItem, pItem);
+
+		return true;
+	}
+
+protected:
+	SListView*						m_pOwner;
+private:	
+	MemberFunctionSlot<LvAdapterHandle, EventArgs>			m_evtSlot_ItemClick;
+	MemberFunctionSlot<LvAdapterHandle, EventArgs>			m_evtSlot_ItemDbClick;
+	MemberFunctionSlot<LvAdapterHandle, EventArgs>			m_evtSlot_ItemRClick;
+	MemberFunctionSlot<LvAdapterHandle, EventArgs>			m_evtSlot_ItemHover;
+	MemberFunctionSlot<LvAdapterHandle, EventArgs>			m_evtSlot_ItemLeave;
+};

+ 43 - 0
vs配置.txt

@@ -0,0 +1,43 @@
+..\__bin\$(Configuration)\
+
+..\__obj\$(Configuration)\$(ProjectName)\
+
+
+..\__LIB\$(Configuration)\$(TargetName).lib
+
+
+
+..\__bin\$(Platform)\$(Configuration)\
+
+..\__obj\$(Platform)\$(Configuration)\$(ProjectName)\
+
+
+..\__LIB\$(Platform)\$(Configuration)\$(TargetName).lib
+
+
+
+$(SolutionDir)$(Platform)\$(Configuration)\
+
+BaseModule
+
+
+ProessBaseModule
+
+$(ProjectDir)\ProessBaseModule.def
+
+$(ProjectDir)\CoreBaseModule.def
+
+$(ProjectDir)\ProessBaseModule.def
+
+crypt32.lib;wldap32.lib;ws2_32.lib;%(AdditionalDependencies)
+CProessBaseGloabl
+
+dt-jc2060.ipaicai.cn
+8212
+nokidc12341
+kkauoq123a
+
+
+crypt32.lib
+wldap32.lib
+ws2_32.lib