diff --git a/MobsetWeb.cpp b/MobsetWeb.cpp new file mode 100644 index 0000000..4f244db --- /dev/null +++ b/MobsetWeb.cpp @@ -0,0 +1,91 @@ +// MobsetWeb.cpp : DLL ������ʵ�֡� + + +#include "stdafx.h" +#include "resource.h" +#include "MobsetWeb_i.h" +#include "dllmain.h" +#include "xdlldata.h" + + +// ����ȷ�� DLL �Ƿ���� OLE ж�ء� +STDAPI DllCanUnloadNow(void) +{ + #ifdef _MERGE_PROXYSTUB + HRESULT hr = PrxDllCanUnloadNow(); + if (hr != S_OK) + return hr; +#endif + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + return (AfxDllCanUnloadNow()==S_OK && _AtlModule.GetLockCount()==0) ? S_OK : S_FALSE; + } + +// ����һ������Դ������������͵Ķ��� +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + #ifdef _MERGE_PROXYSTUB + if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK) + return S_OK; +#endif + return _AtlModule.DllGetClassObject(rclsid, riid, ppv); +} + +// DllRegisterServer - ��ϵͳע���������� +STDAPI DllRegisterServer(void) +{ + // ע��������Ϳ�����Ϳ��е����нӿ� + HRESULT hr = _AtlModule.DllRegisterServer(); + #ifdef _MERGE_PROXYSTUB + if (FAILED(hr)) + return hr; + hr = PrxDllRegisterServer(); +#endif + return hr; +} + +// DllUnregisterServer - ��ϵͳע������Ƴ�� +STDAPI DllUnregisterServer(void) +{ + HRESULT hr = _AtlModule.DllUnregisterServer(); + #ifdef _MERGE_PROXYSTUB + if (FAILED(hr)) + return hr; + hr = PrxDllRegisterServer(); + if (FAILED(hr)) + return hr; + hr = PrxDllUnregisterServer(); +#endif + return hr; +} + +// DllInstall - ���û��ͼ������ϵͳע�������һ����/�Ƴ�� +STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) +{ + HRESULT hr = E_FAIL; + static const wchar_t szUserSwitch[] = L"user"; + + if (pszCmdLine != NULL) + { + if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) + { + ATL::AtlSetPerUserRegistration(true); + } + } + + if (bInstall) + { + hr = DllRegisterServer(); + if (FAILED(hr)) + { + DllUnregisterServer(); + } + } + else + { + hr = DllUnregisterServer(); + } + + return hr; +} + + diff --git a/MobsetWeb.def b/MobsetWeb.def new file mode 100644 index 0000000..0c8d34d --- /dev/null +++ b/MobsetWeb.def @@ -0,0 +1,10 @@ +; MobsetWeb.def : ����ģ������� + +LIBRARY + +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE + DllInstall PRIVATE diff --git a/MobsetWeb.idl b/MobsetWeb.idl new file mode 100644 index 0000000..8e83366 --- /dev/null +++ b/MobsetWeb.idl @@ -0,0 +1,47 @@ +// MobsetWeb.idl : MobsetWeb �� IDL Դ +// + +// ���ļ����� MIDL ���ߴ����� +// �������Ϳ�(MobsetWeb.tlb)�ͷ��ʹ������롣 + +import "oaidl.idl"; +import "ocidl.idl"; + +[ + object, + uuid(5672C687-21CF-4CBE-9E1C-E1460799B581), + dual, + nonextensible, + pointer_default(unique) +] +interface ISms : IDispatch{ + [id(1)] HRESULT CheckPasswd([in] BSTR User, [in] BSTR Passwd, [in] BSTR Encrypt, [in] LONG Purview, [out,retval] LONG* pRet); + [id(11)] HRESULT CheckPasswd2([in] LONG CorpID , [in] BSTR User, [in] BSTR Passwd, [in] BSTR TimeStamp, [in] BSTR Encrypt, [in] LONG Purview, [out, retval] LONG* pRet); + [id(2)] HRESULT GetPasswd([in] BSTR User, [in] BSTR Passwd, [out,retval] BSTR* pRet); + [id(3)] HRESULT EncSPMS([in] BSTR Key, [in] BSTR Src, [out,retval] BSTR* pRet); + [id(4)] HRESULT GetPurview([in] LONG PurviewType, [out,retval] LONG* pRet); + [id(5)] HRESULT HasSWTPre([in] LONG lSDK, [out,retval] LONG* pRet); + [id(6)] HRESULT isHasPurview([in] LONG Purview, [in] LONG AllPurview, [out,retval] LONG* pRet); + [id(7)] HRESULT SendSms([in] IDispatch* pAdoConnect, [in] LONG lCorpID, [in] LONG lUserID, [in] LONG lLongSms,[in] LONG lFD, [in] BSTR Timer, [in] BSTR IP, [in] BSTR AddNum, [in] BSTR Recver,[in] BSTR Mobiles, [in] BSTR Msg, [out,retval] LONG* pSendCount); + [propget, id(8)] HRESULT SendRet([out, retval] BSTR* pVal); + [propput, id(8)] HRESULT SendRet([in] BSTR newVal); + [id(9)] HRESULT SendSms_Excel([in] IDispatch* pAdoConnect, [in] LONG lCorpID, [in] LONG lUserID, [in] LONG lLongSms,[in] LONG lFD, [in] BSTR Timer2, [in] BSTR IP, [in] BSTR ExcelFileName, [out,retval] LONG* lSendCount); + [id(10)] HRESULT CorpSmsHttpReq([in] BSTR pReq, [in] BSTR pIPAddr, [in] BSTR pReqVer, [out,retval] BSTR* pRet); + [id(12)] HRESULT CheckPasswd3([in] LONG CorpID, [in] BSTR User, [in] BSTR Passwd, [in] BSTR TimeStamp, [in] BSTR Encrypt, [in] LONG Purview, [out, retval] BSTR* pRet); +}; +[ + uuid(926542BC-66DD-4977-8850-E29198DDE624), + version(1.0), +] +library MobsetWebLib +{ + importlib("stdole2.tlb"); + [ + uuid(A42502DF-7605-4D99-9F32-FFE224DF5571) + ] + coclass Sms + { + [default] interface ISms; + }; +}; + diff --git a/MobsetWeb.rc b/MobsetWeb.rc new file mode 100644 index 0000000..d57032e Binary files /dev/null and b/MobsetWeb.rc differ diff --git a/MobsetWeb.rgs b/MobsetWeb.rgs new file mode 100644 index 0000000..e7d3740 --- /dev/null +++ b/MobsetWeb.rgs @@ -0,0 +1,3 @@ +HKCR +{ +} diff --git a/MobsetWeb.sln b/MobsetWeb.sln new file mode 100644 index 0000000..e671068 --- /dev/null +++ b/MobsetWeb.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MobsetWeb", "MobsetWeb.vcxproj", "{44F678E3-A3EC-464C-94B1-A2AD95F80CB4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Debug|Win32.ActiveCfg = Debug|Win32 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Debug|Win32.Build.0 = Debug|Win32 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Debug|x64.ActiveCfg = Debug|x64 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Debug|x64.Build.0 = Debug|x64 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Release|Win32.ActiveCfg = Release|Win32 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Release|Win32.Build.0 = Release|Win32 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Release|x64.ActiveCfg = Release|x64 + {44F678E3-A3EC-464C-94B1-A2AD95F80CB4}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/MobsetWeb.vcxproj b/MobsetWeb.vcxproj new file mode 100644 index 0000000..d0f04f4 --- /dev/null +++ b/MobsetWeb.vcxproj @@ -0,0 +1,444 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug x64|Win32"> + <Configuration>Debug x64</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug x64|x64"> + <Configuration>Debug x64</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{44F678E3-A3EC-464C-94B1-A2AD95F80CB4}</ProjectGuid> + <Keyword>AtlProj</Keyword> + <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> + <UseOfAtl>Dynamic</UseOfAtl> + <CharacterSet>Unicode</CharacterSet> + <UseOfMfc>Dynamic</UseOfMfc> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <UseOfAtl>Dynamic</UseOfAtl> + <CharacterSet>Unicode</CharacterSet> + <UseOfMfc>Dynamic</UseOfMfc> + <PlatformToolset>Windows7.1SDK</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <UseOfAtl>Dynamic</UseOfAtl> + <CharacterSet>Unicode</CharacterSet> + <UseOfMfc>Dynamic</UseOfMfc> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <UseOfAtl>Dynamic</UseOfAtl> + <CharacterSet>Unicode</CharacterSet> + <UseOfMfc>Dynamic</UseOfMfc> + <PlatformToolset>Windows7.1SDK</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <UseOfAtl>Static</UseOfAtl> + <CharacterSet>Unicode</CharacterSet> + <UseOfMfc>Static</UseOfMfc> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <UseOfAtl>Static</UseOfAtl> + <CharacterSet>Unicode</CharacterSet> + <UseOfMfc>Static</UseOfMfc> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </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 Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'" Label="PropertySheets"> + <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 Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <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'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IgnoreImportLibrary>true</IgnoreImportLibrary> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> + </ClCompile> + <Midl> + <MkTypLibCompatible>false</MkTypLibCompatible> + <TargetEnvironment>Win32</TargetEnvironment> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <HeaderFileName>MobsetWeb_i.h</HeaderFileName> + <InterfaceIdentifierFileName>MobsetWeb_i.c</InterfaceIdentifierFileName> + <ProxyFileName>MobsetWeb_p.c</ProxyFileName> + <GenerateStublessProxies>true</GenerateStublessProxies> + <TypeLibraryName>$(IntDir)MobsetWeb.tlb</TypeLibraryName> + <DllDataFileName> + </DllDataFileName> + <ValidateAllParameters>true</ValidateAllParameters> + </Midl> + <ResourceCompile> + <Culture>0x0804</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Windows</SubSystem> + <ModuleDefinitionFile>.\MobsetWeb.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> + </ClCompile> + <Midl> + <MkTypLibCompatible>false</MkTypLibCompatible> + <TargetEnvironment>Win32</TargetEnvironment> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <HeaderFileName>MobsetWeb_i.h</HeaderFileName> + <InterfaceIdentifierFileName>MobsetWeb_i.c</InterfaceIdentifierFileName> + <ProxyFileName>MobsetWeb_p.c</ProxyFileName> + <GenerateStublessProxies>true</GenerateStublessProxies> + <TypeLibraryName>$(IntDir)MobsetWeb.tlb</TypeLibraryName> + <DllDataFileName> + </DllDataFileName> + <ValidateAllParameters>true</ValidateAllParameters> + </Midl> + <ResourceCompile> + <Culture>0x0804</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Windows</SubSystem> + <ModuleDefinitionFile>.\MobsetWeb.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> + </ClCompile> + <Midl> + <MkTypLibCompatible>false</MkTypLibCompatible> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <HeaderFileName>MobsetWeb_i.h</HeaderFileName> + <InterfaceIdentifierFileName>MobsetWeb_i.c</InterfaceIdentifierFileName> + <ProxyFileName>MobsetWeb_p.c</ProxyFileName> + <GenerateStublessProxies>true</GenerateStublessProxies> + <TypeLibraryName>$(IntDir)MobsetWeb.tlb</TypeLibraryName> + <DllDataFileName> + </DllDataFileName> + </Midl> + <ResourceCompile> + <Culture>0x0804</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Windows</SubSystem> + <ModuleDefinitionFile>.\MobsetWeb.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> + </ClCompile> + <Midl> + <MkTypLibCompatible>false</MkTypLibCompatible> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <HeaderFileName>MobsetWeb_i.h</HeaderFileName> + <InterfaceIdentifierFileName>MobsetWeb_i.c</InterfaceIdentifierFileName> + <ProxyFileName>MobsetWeb_p.c</ProxyFileName> + <GenerateStublessProxies>true</GenerateStublessProxies> + <TypeLibraryName>$(IntDir)MobsetWeb.tlb</TypeLibraryName> + <DllDataFileName> + </DllDataFileName> + </Midl> + <ResourceCompile> + <Culture>0x0804</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Windows</SubSystem> + <ModuleDefinitionFile>.\MobsetWeb.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> + </ClCompile> + <Midl> + <MkTypLibCompatible>false</MkTypLibCompatible> + <TargetEnvironment>Win32</TargetEnvironment> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <HeaderFileName>MobsetWeb_i.h</HeaderFileName> + <InterfaceIdentifierFileName>MobsetWeb_i.c</InterfaceIdentifierFileName> + <ProxyFileName>MobsetWeb_p.c</ProxyFileName> + <GenerateStublessProxies>true</GenerateStublessProxies> + <TypeLibraryName>$(IntDir)MobsetWeb.tlb</TypeLibraryName> + <DllDataFileName> + </DllDataFileName> + <ValidateAllParameters>true</ValidateAllParameters> + </Midl> + <ResourceCompile> + <Culture>0x0804</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Windows</SubSystem> + <ModuleDefinitionFile>.\MobsetWeb.def</ModuleDefinitionFile> + <GenerateDebugInformation>No</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <RegisterOutput>true</RegisterOutput> + <EnableUAC>false</EnableUAC> + <UACUIAccess>true</UACUIAccess> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ForceConformanceInForLoopScope>false</ForceConformanceInForLoopScope> + </ClCompile> + <Midl> + <MkTypLibCompatible>false</MkTypLibCompatible> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <HeaderFileName>MobsetWeb_i.h</HeaderFileName> + <InterfaceIdentifierFileName>MobsetWeb_i.c</InterfaceIdentifierFileName> + <ProxyFileName>MobsetWeb_p.c</ProxyFileName> + <GenerateStublessProxies>true</GenerateStublessProxies> + <TypeLibraryName>$(IntDir)MobsetWeb.tlb</TypeLibraryName> + <DllDataFileName> + </DllDataFileName> + </Midl> + <ResourceCompile> + <Culture>0x0804</Culture> + <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Link> + <SubSystem>Windows</SubSystem> + <ModuleDefinitionFile>.\MobsetWeb.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <RegisterOutput>true</RegisterOutput> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\public\ado\Ado.cpp" /> + <ClCompile Include="..\public\ado\AdoCommand.cpp" /> + <ClCompile Include="..\public\ado\AdoRecordSet.cpp" /> + <ClCompile Include="..\public\CMarkup\Markup.cpp" /> + <ClCompile Include="..\public\des\Des.cpp" /> + <ClCompile Include="..\public\LuTool.cpp" /> + <ClCompile Include="..\public\md53\MD5_L.cpp" /> + <ClCompile Include="..\public\SqlPool\SqlPool.cpp" /> + <ClCompile Include="..\public\StringSort\StringSort.cpp" /> + <ClCompile Include="dllmain.cpp"> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'">false</CompileAsManaged> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'"> + </PrecompiledHeader> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + </PrecompiledHeader> + </ClCompile> + <ClCompile Include="MobsetWeb.cpp" /> + <ClCompile Include="MobsetWeb_i.c"> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'">false</CompileAsManaged> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'"> + </PrecompiledHeader> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + </PrecompiledHeader> + </ClCompile> + <ClCompile Include="Sms.cpp" /> + <ClCompile Include="stdafx.cpp"> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> + </ClCompile> + <ClCompile Include="xdlldata.c"> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'">false</CompileAsManaged> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'"> + </PrecompiledHeader> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> + <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + </PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + </PrecompiledHeader> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\public\ado\Ado.h" /> + <ClInclude Include="..\public\ado\AdoCommand.h" /> + <ClInclude Include="..\public\ado\AdoRecordSet.h" /> + <ClInclude Include="..\public\AutoCoInitializeEx\AutoCoInitializeEx.h" /> + <ClInclude Include="..\public\CMarkup\Markup.h" /> + <ClInclude Include="..\public\des\Des.h" /> + <ClInclude Include="..\public\LuTool.h" /> + <ClInclude Include="..\public\md53\MD5_L.h" /> + <ClInclude Include="..\public\SAStatusLog\SAStatusLog.h" /> + <ClInclude Include="..\public\SendPub.h" /> + <ClInclude Include="..\public\SqlPool\SqlPool.h" /> + <ClInclude Include="..\public\StringSort\StringSort.h" /> + <ClInclude Include="dllmain.h" /> + <ClInclude Include="MobsetWeb_i.h" /> + <ClInclude Include="Resource.h" /> + <ClInclude Include="Sms.h" /> + <ClInclude Include="stdafx.h" /> + <ClInclude Include="targetver.h" /> + <ClInclude Include="xdlldata.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="MobsetWeb.rc" /> + </ItemGroup> + <ItemGroup> + <None Include="MobsetWeb.def" /> + <None Include="MobsetWeb.rgs" /> + <None Include="ReadMe.txt" /> + <None Include="Sms.rgs" /> + </ItemGroup> + <ItemGroup> + <Midl Include="MobsetWeb.idl" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/MobsetWeb.vcxproj.filters b/MobsetWeb.vcxproj.filters new file mode 100644 index 0000000..02043f5 --- /dev/null +++ b/MobsetWeb.vcxproj.filters @@ -0,0 +1,149 @@ +<?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;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="头文件"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;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="生成的文件"> + <UniqueIdentifier>{b6f6edc5-6eea-4d8b-b627-3ee73adbc9b4}</UniqueIdentifier> + <SourceControlFiles>False</SourceControlFiles> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="stdafx.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="MobsetWeb.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="dllmain.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="xdlldata.c"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="MobsetWeb_i.c"> + <Filter>生成的文件</Filter> + </ClCompile> + <ClCompile Include="Sms.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\des\Des.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\ado\Ado.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\ado\AdoCommand.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\ado\AdoRecordSet.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\md53\MD5_L.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\LuTool.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\StringSort\StringSort.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\SqlPool\SqlPool.cpp"> + <Filter>源文件</Filter> + </ClCompile> + <ClCompile Include="..\public\CMarkup\Markup.cpp"> + <Filter>源文件</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="stdafx.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="targetver.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="Resource.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="dllmain.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="xdlldata.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="MobsetWeb_i.h"> + <Filter>生成的文件</Filter> + </ClInclude> + <ClInclude Include="Sms.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\des\Des.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\SendPub.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\ado\Ado.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\ado\AdoCommand.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\ado\AdoRecordSet.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\md53\MD5_L.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\SAStatusLog\SAStatusLog.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\LuTool.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\StringSort\StringSort.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\SqlPool\SqlPool.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\CMarkup\Markup.h"> + <Filter>头文件</Filter> + </ClInclude> + <ClInclude Include="..\public\AutoCoInitializeEx\AutoCoInitializeEx.h"> + <Filter>头文件</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="MobsetWeb.rc"> + <Filter>资源文件</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <None Include="ReadMe.txt" /> + <None Include="MobsetWeb.rgs"> + <Filter>资源文件</Filter> + </None> + <None Include="MobsetWeb.def"> + <Filter>源文件</Filter> + </None> + <None Include="Sms.rgs"> + <Filter>资源文件</Filter> + </None> + </ItemGroup> + <ItemGroup> + <Midl Include="MobsetWeb.idl"> + <Filter>源文件</Filter> + </Midl> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/MobsetWeb_i.h b/MobsetWeb_i.h new file mode 100644 index 0000000..0faef7b --- /dev/null +++ b/MobsetWeb_i.h @@ -0,0 +1,456 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0622 */ +/* at Tue Jan 19 11:14:07 2038 + */ +/* Compiler settings for MobsetWeb.idl: + Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __MobsetWeb_i_h__ +#define __MobsetWeb_i_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ISms_FWD_DEFINED__ +#define __ISms_FWD_DEFINED__ +typedef interface ISms ISms; + +#endif /* __ISms_FWD_DEFINED__ */ + + +#ifndef __Sms_FWD_DEFINED__ +#define __Sms_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class Sms Sms; +#else +typedef struct Sms Sms; +#endif /* __cplusplus */ + +#endif /* __Sms_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +#ifndef __ISms_INTERFACE_DEFINED__ +#define __ISms_INTERFACE_DEFINED__ + +/* interface ISms */ +/* [unique][nonextensible][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISms; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5672C687-21CF-4CBE-9E1C-E1460799B581") + ISms : public IDispatch + { + public: + virtual /* [id] */ HRESULT STDMETHODCALLTYPE CheckPasswd( + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [in] */ BSTR Encrypt, + /* [in] */ LONG Purview, + /* [retval][out] */ LONG *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE CheckPasswd2( + /* [in] */ LONG CorpID, + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [in] */ BSTR TimeStamp, + /* [in] */ BSTR Encrypt, + /* [in] */ LONG Purview, + /* [retval][out] */ LONG *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetPasswd( + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [retval][out] */ BSTR *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE EncSPMS( + /* [in] */ BSTR Key, + /* [in] */ BSTR Src, + /* [retval][out] */ BSTR *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetPurview( + /* [in] */ LONG PurviewType, + /* [retval][out] */ LONG *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE HasSWTPre( + /* [in] */ LONG lSDK, + /* [retval][out] */ LONG *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE isHasPurview( + /* [in] */ LONG Purview, + /* [in] */ LONG AllPurview, + /* [retval][out] */ LONG *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendSms( + /* [in] */ IDispatch *pAdoConnect, + /* [in] */ LONG lCorpID, + /* [in] */ LONG lUserID, + /* [in] */ LONG lLongSms, + /* [in] */ LONG lFD, + /* [in] */ BSTR Timer, + /* [in] */ BSTR IP, + /* [in] */ BSTR AddNum, + /* [in] */ BSTR Recver, + /* [in] */ BSTR Mobiles, + /* [in] */ BSTR Msg, + /* [retval][out] */ LONG *pSendCount) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_SendRet( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_SendRet( + /* [in] */ BSTR newVal) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendSms_Excel( + /* [in] */ IDispatch *pAdoConnect, + /* [in] */ LONG lCorpID, + /* [in] */ LONG lUserID, + /* [in] */ LONG lLongSms, + /* [in] */ LONG lFD, + /* [in] */ BSTR Timer2, + /* [in] */ BSTR IP, + /* [in] */ BSTR ExcelFileName, + /* [retval][out] */ LONG *lSendCount) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE CorpSmsHttpReq( + /* [in] */ BSTR pReq, + /* [in] */ BSTR pIPAddr, + /* [in] */ BSTR pReqVer, + /* [retval][out] */ BSTR *pRet) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE CheckPasswd3( + /* [in] */ LONG CorpID, + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [in] */ BSTR TimeStamp, + /* [in] */ BSTR Encrypt, + /* [in] */ LONG Purview, + /* [retval][out] */ BSTR *pRet) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISmsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISms * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISms * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISms * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISms * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISms * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISms * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISms * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CheckPasswd )( + ISms * This, + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [in] */ BSTR Encrypt, + /* [in] */ LONG Purview, + /* [retval][out] */ LONG *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CheckPasswd2 )( + ISms * This, + /* [in] */ LONG CorpID, + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [in] */ BSTR TimeStamp, + /* [in] */ BSTR Encrypt, + /* [in] */ LONG Purview, + /* [retval][out] */ LONG *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetPasswd )( + ISms * This, + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [retval][out] */ BSTR *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *EncSPMS )( + ISms * This, + /* [in] */ BSTR Key, + /* [in] */ BSTR Src, + /* [retval][out] */ BSTR *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetPurview )( + ISms * This, + /* [in] */ LONG PurviewType, + /* [retval][out] */ LONG *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *HasSWTPre )( + ISms * This, + /* [in] */ LONG lSDK, + /* [retval][out] */ LONG *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *isHasPurview )( + ISms * This, + /* [in] */ LONG Purview, + /* [in] */ LONG AllPurview, + /* [retval][out] */ LONG *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendSms )( + ISms * This, + /* [in] */ IDispatch *pAdoConnect, + /* [in] */ LONG lCorpID, + /* [in] */ LONG lUserID, + /* [in] */ LONG lLongSms, + /* [in] */ LONG lFD, + /* [in] */ BSTR Timer, + /* [in] */ BSTR IP, + /* [in] */ BSTR AddNum, + /* [in] */ BSTR Recver, + /* [in] */ BSTR Mobiles, + /* [in] */ BSTR Msg, + /* [retval][out] */ LONG *pSendCount); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SendRet )( + ISms * This, + /* [retval][out] */ BSTR *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SendRet )( + ISms * This, + /* [in] */ BSTR newVal); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendSms_Excel )( + ISms * This, + /* [in] */ IDispatch *pAdoConnect, + /* [in] */ LONG lCorpID, + /* [in] */ LONG lUserID, + /* [in] */ LONG lLongSms, + /* [in] */ LONG lFD, + /* [in] */ BSTR Timer2, + /* [in] */ BSTR IP, + /* [in] */ BSTR ExcelFileName, + /* [retval][out] */ LONG *lSendCount); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CorpSmsHttpReq )( + ISms * This, + /* [in] */ BSTR pReq, + /* [in] */ BSTR pIPAddr, + /* [in] */ BSTR pReqVer, + /* [retval][out] */ BSTR *pRet); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CheckPasswd3 )( + ISms * This, + /* [in] */ LONG CorpID, + /* [in] */ BSTR User, + /* [in] */ BSTR Passwd, + /* [in] */ BSTR TimeStamp, + /* [in] */ BSTR Encrypt, + /* [in] */ LONG Purview, + /* [retval][out] */ BSTR *pRet); + + END_INTERFACE + } ISmsVtbl; + + interface ISms + { + CONST_VTBL struct ISmsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISms_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISms_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISms_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISms_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define ISms_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define ISms_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define ISms_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define ISms_CheckPasswd(This,User,Passwd,Encrypt,Purview,pRet) \ + ( (This)->lpVtbl -> CheckPasswd(This,User,Passwd,Encrypt,Purview,pRet) ) + +#define ISms_CheckPasswd2(This,CorpID,User,Passwd,TimeStamp,Encrypt,Purview,pRet) \ + ( (This)->lpVtbl -> CheckPasswd2(This,CorpID,User,Passwd,TimeStamp,Encrypt,Purview,pRet) ) + +#define ISms_GetPasswd(This,User,Passwd,pRet) \ + ( (This)->lpVtbl -> GetPasswd(This,User,Passwd,pRet) ) + +#define ISms_EncSPMS(This,Key,Src,pRet) \ + ( (This)->lpVtbl -> EncSPMS(This,Key,Src,pRet) ) + +#define ISms_GetPurview(This,PurviewType,pRet) \ + ( (This)->lpVtbl -> GetPurview(This,PurviewType,pRet) ) + +#define ISms_HasSWTPre(This,lSDK,pRet) \ + ( (This)->lpVtbl -> HasSWTPre(This,lSDK,pRet) ) + +#define ISms_isHasPurview(This,Purview,AllPurview,pRet) \ + ( (This)->lpVtbl -> isHasPurview(This,Purview,AllPurview,pRet) ) + +#define ISms_SendSms(This,pAdoConnect,lCorpID,lUserID,lLongSms,lFD,Timer,IP,AddNum,Recver,Mobiles,Msg,pSendCount) \ + ( (This)->lpVtbl -> SendSms(This,pAdoConnect,lCorpID,lUserID,lLongSms,lFD,Timer,IP,AddNum,Recver,Mobiles,Msg,pSendCount) ) + +#define ISms_get_SendRet(This,pVal) \ + ( (This)->lpVtbl -> get_SendRet(This,pVal) ) + +#define ISms_put_SendRet(This,newVal) \ + ( (This)->lpVtbl -> put_SendRet(This,newVal) ) + +#define ISms_SendSms_Excel(This,pAdoConnect,lCorpID,lUserID,lLongSms,lFD,Timer2,IP,ExcelFileName,lSendCount) \ + ( (This)->lpVtbl -> SendSms_Excel(This,pAdoConnect,lCorpID,lUserID,lLongSms,lFD,Timer2,IP,ExcelFileName,lSendCount) ) + +#define ISms_CorpSmsHttpReq(This,pReq,pIPAddr,pReqVer,pRet) \ + ( (This)->lpVtbl -> CorpSmsHttpReq(This,pReq,pIPAddr,pReqVer,pRet) ) + +#define ISms_CheckPasswd3(This,CorpID,User,Passwd,TimeStamp,Encrypt,Purview,pRet) \ + ( (This)->lpVtbl -> CheckPasswd3(This,CorpID,User,Passwd,TimeStamp,Encrypt,Purview,pRet) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISms_INTERFACE_DEFINED__ */ + + + +#ifndef __MobsetWebLib_LIBRARY_DEFINED__ +#define __MobsetWebLib_LIBRARY_DEFINED__ + +/* library MobsetWebLib */ +/* [version][uuid] */ + + +EXTERN_C const IID LIBID_MobsetWebLib; + +EXTERN_C const CLSID CLSID_Sms; + +#ifdef __cplusplus + +class DECLSPEC_UUID("A42502DF-7605-4D99-9F32-FFE224DF5571") +Sms; +#endif +#endif /* __MobsetWebLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); + +unsigned long __RPC_USER BSTR_UserSize64( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal64( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal64(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree64( unsigned long *, BSTR * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..8f04387 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,66 @@ +======================================================================== + 活动模板库 : MobsetWeb 项目概述 +======================================================================== + +应用程序向导已为您创建了此 MobsetWeb 项目,作为编写动态链接库 (DLL) +的起点。 + +本文件概要介绍组成项目的每个文件的内容。 + +MobsetWeb.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件, + 其中包含生成该文件的 Visual C++ 的版本信息, + 以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +MobsetWeb.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 + 它包含有关项目文件与筛选器之间的关联信息。 在 IDE 中,通过这种关联, + 在特定节点下以分组形式显示具有相似扩展名的文件。 + 例如,“.cpp”文件与“源文件”筛选器关联。 + +MobsetWeb.idl + 此文件包含项目中定义的类型库、接口和组件类的 IDL 定义。 + 此文件将由 MIDL 编译器处理以生成: + C++ 接口定义和 GUID 声明 (MobsetWeb.h) + GUID 定义 (MobsetWeb_i.c) + 类型库 (MobsetWeb.tlb) + 封送处理代码 (MobsetWeb_p.c 和 + dlldata.c) + +MobsetWeb.h + 此文件包含 MobsetWeb.idl 中定义的项目的 C++ 接口定义 + 和 GUID 声明。 它将在编译过程中由 MIDL 重新生成。 + +MobsetWeb.cpp + 此文件包含对象映射和 DLL 导出的实现。 + +MobsetWeb.rc + 这是程序使用的所有 Microsoft Windows 资源的列表。 + +MobsetWeb.def + 此模块定义文件为链接器提供有关 DLL 所要求的导出的信息, + 它包含用于以下内容的导出: + DllGetClassObject + DllCanUnloadNow + DllRegisterServer + DllUnregisterServer + DllInstall + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h,StdAfx.cpp + 这些文件用于生成名为 MobsetWeb.pch 的预编译头 (PCH) 文件和 + 名为 StdAfx.obj 的预编译类型文件。 + +Resource.h + 这是用于定义资源 ID 的标准头文件。 + + +///////////////////////////////////////////////////////////////////////////// +其他注释: + + + “MFC 支持”选项可用于将 Microsoft 基础类库构建到您的主干应用程序中, + 从而让您能够使用 MFC 类、对象和函数。 +///////////////////////////////////////////////////////////////////////////// diff --git a/Sms.cpp b/Sms.cpp new file mode 100644 index 0000000..efeadbc --- /dev/null +++ b/Sms.cpp @@ -0,0 +1,1401 @@ +// Sms.cpp : CSms ��ʵ�� + +#include "stdafx.h" +#include "Sms.h" + +#include "..\public\LuTool.h" +#include "..\public\SendPub.h" +#include "..\public\sendpub.cpp" //����ڹ����м��룬���Ҳ���CW2A +#include "..\public\StringSort\StringSort.h" +#include "..\public\SAStatusLog\SAStatusLog.cpp" //����ڹ����м��룬���Ҳ���CW2A +#include "..\public\CMarkup\Markup.h" +#include "..\public\AutoCoInitializeEx\AutoCoInitializeEx.h" +// CSms + + + +STDMETHODIMP CSms::CheckPasswd(BSTR User, BSTR Passwd, BSTR Encrypt, LONG Purview, LONG* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + //ȡ��User ,Passwd + char szUser[64]={0}; + char szPasswd[128]={0}; + char szPasswd2[128]={0}; + char szEncrypt[128]={0}; + strcpy( szUser , CW2A(User) ); + strcpy( szPasswd , CW2A(Passwd) ); + strcpy( szEncrypt , CW2A(Encrypt) ); + + if (strlen(szUser) <= 0 || strlen(szPasswd)<=0) //�û���������Ϊ�գ���֤��ͨ�� + { + *pRet = 0; + return S_OK; + } + + CDes des; + long lLen=sizeof(Passwd); + des.Encrypt( szPasswd , strlen(szPasswd) , szPasswd2 , lLen , szUser , 8 ); + if ( !strcmp( szPasswd2 , szEncrypt ) ) + { + *pRet = 1; + } + else + { + *pRet = 0; + } + if ( !(Purview&PURVIEW_LOGIN) ) + { + *pRet = -1; + } +/* + if ( !(Purview&PURVIEW_SENDP) ) + { + *pRet = -2; + } +*/ + + return S_OK; +} + + +STDMETHODIMP CSms::CheckPasswd2(LONG CorpID, BSTR User, BSTR Passwd, BSTR TimeStamp, BSTR Encrypt, LONG Purview, LONG* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + + //ȡ��User ,Passwd + char szUser[64] = { 0 }; + char szPasswd[128] = { 0 }; + char szPasswd2[128] = { 0 }; + char szEncrypt[128] = { 0 }; + TCHAR szPasswdU2[128] = { 0 }; + strcpy(szUser, CW2A(User)); + strcpy(szPasswd, CW2A(Passwd)); + strcpy(szEncrypt, CW2A(Encrypt)); + + if (strlen(szUser) <= 0 || strlen(szPasswd) <= 0) //�û���������Ϊ�գ���֤��ͨ�� + { + *pRet = 0; + return S_OK; + } + + CDes des; + + long lOut = sizeof(szPasswd2); + des.Decrypt(szEncrypt, (long)strlen(szEncrypt), szPasswd2, lOut, szUser, 8); + _tcscpy(szPasswdU2, CA2W(szPasswd2)); + + CString strCorpID; + strCorpID.Format(_T("%d"), CorpID); + CString strPasswd2 = szPasswdU2; + CString strTimeStamp = TimeStamp; + + CString strMd5 = Passwd; + strMd5.MakeUpper(); + + CString strMd52 = CSendPub::GetMD5(strCorpID + strPasswd2 + strTimeStamp, false); + strMd52.MakeUpper(); + + if (strMd5 == strMd52) + { + *pRet = 1; + } + else + { + *pRet = 0; + } + + + if (!(Purview&PURVIEW_LOGIN)) + { + *pRet = -1; + } + /* + if (!(Purview&PURVIEW_SENDP)) + { + *pRet = -2; + } + */ + + + return S_OK; +} + + +STDMETHODIMP CSms::GetPasswd(BSTR User, BSTR Passwd, BSTR* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + //ȡ��User ,Passwd + char szUser[64]={0}; + char szPasswd[128]={0}; + char szPasswd2[128]={0}; + char szEncrypt[128]={0}; + strcpy( szUser , CW2A(User) ); + strcpy( szPasswd , CW2A(Passwd) ); + + CDes des; + long lLen=sizeof(szPasswd2); + des.Encrypt(szPasswd , strlen(szPasswd) , szPasswd2 , lLen , szUser , 8 ); + + *pRet = ::SysAllocString(CA2W(szPasswd2)); + + + return S_OK; +} + + +STDMETHODIMP CSms::DePasswd(BSTR User, BSTR Passwd, BSTR* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + *pRet = ::SysAllocString(CA2W("ERROR")); +/* + //ȡ��User ,Passwd + char szUser[64]={0}; + char szPasswd[128]={0}; + char szPasswd2[128]={0}; + char szEncrypt[128]={0}; + strcpy( szUser , CW2A(User) ); + strcpy( szPasswd , CW2A(Passwd) ); + + CDes des; + long lLen=sizeof(szPasswd2); + des.Decrypt(szPasswd , strlen(szPasswd) , szPasswd2 , lLen , szUser , 8 ); + + *pRet = ::SysAllocString(CA2W(szPasswd2)); +*/ + return S_OK; +} + +void CSms::GetCurrentPath(TCHAR *pPath) +{ + ::GetModuleFileName(AfxGetInstanceHandle(), pPath, 512); + int j = lstrlen(pPath); + for (; j>0; j--) + { + if (pPath[j] == '\\') + break; + } + pPath[j + 1] = 0; +} + + + +STDMETHODIMP CSms::EncSPMS(BSTR Key, BSTR Src, BSTR* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + +/* + //ȡ��User ,Passwd + char szKey[512]={0}; + char szSrc[512]={0}; + char szRet[512]={0}; + strcpy( szKey , CW2A(Key) ); + strcpy( szSrc , CW2A(Src) ); + + CDES des; + if ( !des.EncSPMS(szKey,szSrc,szRet) ) + { + strcpy( szRet , "ERROR" ); + } + + *pRet = ::SysAllocString(CA2W(szRet)); +*/ + return S_OK; +} + + +STDMETHODIMP CSms::GetPurview(LONG PurviewType, LONG* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + long lPurview=0; + + if ( PurviewType == PURVIEWTYPE_INPUT ) //����¼��Ա + { + lPurview = lPurview|PURVIEW_LOGIN|PURVIEW_GADDRESS_SEE|PURVIEW_GADDRESS_MODIFY|PURVIEW_GADDRESS_ADD; + } + if ( PurviewType == PURVIEWTYPE_USERS ) //һ��Ա�� + { + lPurview = lPurview|PURVIEW_LOGIN|PURVIEW_SENDG|PURVIEW_RECVP|PURVIEW_GADDRESS_SEE; + } + if ( PurviewType == PURVIEWTYPE_KF ) //�ͻ�����Ա + { + lPurview = lPurview|PURVIEW_LOGIN|PURVIEW_SENDG|PURVIEW_SENDP|PURVIEW_RECVP|PURVIEW_RECVG|PURVIEW_GADDRESS_SEE|PURVIEW_PADDRESS; + } + if ( PurviewType == PURVIEWTYPE_ADMIN ) //����Ա + { + lPurview = -1; + } + *pRet = lPurview; + + return S_OK; +} + + +STDMETHODIMP CSms::HasSWTPre(LONG lSDK, LONG* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + if ( lSDK & SDK_SWT ) + *pRet = 1; + else + *pRet = 0; + + return S_OK; +} + + +STDMETHODIMP CSms::isHasPurview(LONG Purview, LONG AllPurview, LONG* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + if ( AllPurview & Purview ) + *pRet = 1; + else + *pRet = 0; + + return S_OK; +} + + +STDMETHODIMP CSms::SendSms(IDispatch* pAdoConnect, LONG lCorpID, LONG lUserID, LONG lLongSms, LONG lFD, BSTR Timer, BSTR IP, BSTR AddNum, BSTR Recver, BSTR Mobiles, BSTR Msg, LONG* pSendCount) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + //AutoCoInitializeEx AutoCoInit(true); //�Զ���ʼ�������Com���� + + *pSendCount = 0; + m_strSendRet=_T("-10,�����쳣!"); + + DWORD lSendAllTime = GetTickCount(); + + //m_strSendRet.Format(_T("AdoConnect:%x,CorpID:%d,UserID,%d,longSms,%d,Timer,%s\\nIP=%s\\nMobiles=%s\\nMsg=%s"),pAdoConnect,lCorpID,lUserID,lLongSms,Timer,IP,Mobiles,Msg); + //return S_OK; + try + { + if (!pAdoConnect) + { + m_strSendRet=_T("-11,�����쳣!"); + return S_OK; + } + //CComQIPtr<_ConnectionPtr> pAdo = pAdoConnect; + _ConnectionPtr pAdo = pAdoConnect; + //pAdoConnect->QueryInterface( + //CAdoConnection adoConnection((_ConnectionPtr)pAdo); + //CAdoConnection adoc2; + /* + if ( !m_AdoConnection.IsOpen() ) + { + m_AdoConnection.SetConnection(pAdoConnect); + } + CString strConnectionString = m_AdoConnection.GetConnectionString(); + if (strConnectionString.GetLength() <= 6) + { + m_strSendRet = _T("-15,ϵͳ�쳣1!"); + return S_OK; + } + */ + + TCHAR szName[512] = { 0 }; + GetCurrentPath(szName); + SC_Setup setup = { 0 }; + CFile file; + CString strFileName; + //�ظ��������ļ������������������Ͷ����ݵ� + for (int j = 0; j<3; j++) + { + strFileName.Format(_T("%s..\\%s"), szName, _T("SmsCenterW.dat")); + switch (j) + { + case 1: + strFileName.Format(_T("%s..\\%s"), szName, _T("SmsCenterW_b1.dat")); + break; + case 2: + strFileName.Format(_T("%s%s"), szName, _T("SmsCenterW.dat")); + break; + } + if (file.Open(strFileName, CFile::modeRead|CFile::shareDenyNone) ) + { + if (file.GetLength() > 50) + break; + else + file.Close(); + } + } + if (j >= 3) + { + //m_strSendRet = _T("-21,�������ļ��쳣!"); + //m_strSendRet.Format(_T("-21,�������ļ��쳣!%s"),strFileName); + //return S_OK; + //��ȡ�����ļ����ɹ���ʹ��ԭ���������� + if (!m_AdoConnection.IsOpen()) + { + m_AdoConnection.SetConnection(pAdoConnect); + } + } + else + { + file.Read(&setup, sizeof(setup)); + file.Close(); + + CString DBServer = setup.szDBName; + CString DBName = _T("corpsms"); + CString DBUser = setup.szDBUser; + CString DBProvider = setup.szProvider; + + //�����ݿ����� + char szSrc[64] = { 0 }; + char szUser[64] = { 0 }; + char szTag[64] = { 0 }; + TCHAR szNewPasswd[64] = { 0 }; + long lOut = sizeof(szTag); + strcpy(szSrc, CW2A(setup.szDBPasswd)); + strcpy(szUser, CW2A(setup.szDBUser)); + CDes des; + des.Decrypt(szSrc, strlen(szSrc), szTag, lOut, szUser, 8); + _tcscpy(szNewPasswd, CA2W(szTag)); + CString DBPasswd = szNewPasswd; + if (!m_AdoConnection.ConnectSQLServer2(DBServer, DBName, DBUser, DBPasswd, DBProvider)) + { + m_strSendRet = _T("-16,ϵͳ�쳣2���������ݿ�ʧ��!"); + return S_OK; + } + } + //m_AdoConnection.SetCursorLocation(adUseServer); //����Ϊ�����α����� + + CAdoRecordSet AdoRS; + CAdoRecordSet AdoRS2; + AdoRS.SetCursorLocation(adUseClient);//adUseNone adUseServer + AdoRS.SetCursorLocation(adUseClient); + AdoRS.SetAdoConnection(&m_AdoConnection); + AdoRS2.SetAdoConnection(&m_AdoConnection); + + AdoRS.SetCursorLocation(adUseClient); + AdoRS2.SetCursorLocation(adUseClient); + CString str; + CString strErrMsg; + CString strMsgID; + + CString strMsg = Msg; + CString strIP = IP; + CString strRecver = Recver; + CString strAddNum = AddNum; + BOOL bSDK=false; + if ( strRecver==CString(_T("WebSDK")) || strRecver == CString(_T("WebSDK2"))) + bSDK = true; + + if (strMsg.GetLength()<=0 || strMsg.GetLength()>900) + { + m_strSendRet=_T("-12,�������ݳ��Ȳ�����Ҫ��!"); + return S_OK; + } + //�滻ǩ���ַ�����ֹ��ǩ�� + + /* + strMsg.Replace(_T("["), _T("(")); //������Զ��������ţ���ȥ���� + strMsg.Replace(_T("]"), _T(")")); + strMsg.Replace(_T("��"), _T("(")); //������Զ��������ţ���ȥ���� + strMsg.Replace(_T("��"), _T(")")); + */ + + BOOL bEnableXY=false; //�Ƿ����������� + + BOOL bAtTime=false; + COleDateTime tTimer; + CString strTimer = Timer; + strTimer.Replace(_T("/") , _T("-")); + try + { + tTimer.ParseDateTime(strTimer); + } + catch(...) + { + } + + CString strSelect; + //ȡͨ�� + TCHAR szSmsTD[32]={0}; + //ȡǩ�� + CString strCM; + long lFStep=1; //Ĭ��Ϊ1�� + long lSmsFStep = 99; //������ + strSelect.Format(_T("select * from corp with(nolock) where corpid=%d") , lCorpID ); + if ( AdoRS.Open(strSelect) && !AdoRS.IsEOF() ) + { + AdoRS.GetCollect(_T("cm") , strCM ); + AdoRS.GetCollect(_T("FStep"),lFStep); + AdoRS.GetCollect(_T("FiltStep"), lSmsFStep); + AdoRS.GetCollect( _T("SMSTD") , szSmsTD ); _tcscat(szSmsTD,_T("000000")); //ȡ�ö���ͨ�� + DWORD dwCorpSDK=0; + AdoRS.GetCollect(_T("SDK") , dwCorpSDK ); //SDK + if ( dwCorpSDK & SDK_XY ) //�Ƿ�������Ȩ�� + { + bEnableXY = true; + } + + } + + + long lCorpID2 = 0; + strSelect.Format(_T("select * from users with(nolock) where userid=%d") , lUserID ); + if ( AdoRS.Open(strSelect) && !AdoRS.IsEOF() ) + { + AdoRS.GetCollect(_T("CorpID") , lCorpID2 ); + if ( lCorpID2 != lCorpID ) + { + m_strSendRet=_T("-13,��ҵID���û�ID����Ӧ������ֹͣ!"); + return S_OK; + } + CString strCM2; + AdoRS.GetCollect(_T("cm2") , strCM2 ); + if ( strCM2.GetLength()>0 ) + strCM = strCM2; + } + + + if (strCM==CString(_T("+"))) //ǩ��Ϊ+��ʱ����������ǩ������ֻ�ܷ����ѱ���ǩ�� + { + //����ǩ�� + CString strGetCM; + long lMsgLen = strMsg.GetLength(); + if (lMsgLen > 1 && strMsg.Left(1) == CString(_T("��"))) //�������ݳ��ȴ���1�������ԡ���ͷ�� + { + for (int i = 1; i < lMsgLen && i < 20; i++) + { + if (strMsg.Mid(i, 1) == CString(_T("��"))) + { + strGetCM = strMsg.Mid(1, i - 1); + break; + } + } + + } + if (strGetCM.GetLength() >= 2) + { + strSelect.Format(_T("select * from SignName with(nolock) where corpid=%d and SignName='%s' and status=1"), lCorpID, SqlStr(strGetCM)); + if (AdoRS.Open(strSelect) && AdoRS.IsEOF()) + { + m_strSendRet = _T("-17,ǩ��δ������ǩ��δ���ͨ��!"); + return S_OK; + } + } + else + { + m_strSendRet = _T("-17,ǩ��δ������ǩ��δ���ͨ��!"); + return S_OK; + } + strCM=CString( _T("")); //+��ǩ����Ϊ�ա� + } + + + //�Ƿ���Ҫ��� + BOOL bFilt=false; + strSelect.Format(_T("select * from filt where FStep>=%d and CHARINDEX(word,'%s')>0") , lFStep,SqlStr(strMsg) ); + if ( AdoRS.Open(strSelect) && !AdoRS.IsEOF() ) + { + bFilt = 1; + + //m_strSendRet=_T("-101,���������쳣������ֹͣ!"); + //return S_OK; + } + if (!bFilt) //����Ҫ��˵ģ������ո�����жϹؼ��� + { + long lSrcLen = strMsg.GetLength(); + CString strNoSpace = strMsg; + strNoSpace.Replace(_T(" "), _T("")); + strNoSpace.Replace(_T("��"), _T("")); + long lNoSpaceLen = strNoSpace.GetLength(); + if (lFStep<3 && (lSrcLen - lNoSpaceLen >4) ) //����2���ո���Ҫ����� + { + bFilt = 1; + } + if (!bFilt && (lSrcLen - lNoSpaceLen >2 )) //����Ҫ��˵ģ������ո�����жϹؼ��� + { + strSelect.Format(_T("select * from filt where FStep>=%d and CHARINDEX(word,'%s')>0"), lFStep, SqlStr(strNoSpace)); + if (AdoRS.Open(strSelect) && !AdoRS.IsEOF()) + { + bFilt = 1; + } + } + } + + //�ж��ֻ���������Ƿ��� + CString strMobiles = Mobiles; + long lMobiles = strMobiles.GetLength() / 12; + if (!bSDK && (lMobiles >= lSmsFStep || lMobiles>=10) ) + { + bFilt = 1; + } + if ( bSDK && strRecver == CString(_T("WebSDK")) && lMobiles>58) //�����SDK1������������50��ʱ��Ҳ����Ҫ��˵ġ� + { + bFilt = 1; + } + if (strRecver == CString(_T("WebF"))) + { + bFilt = 1; + } + if ( lSmsFStep == 5185 || lSmsFStep == 51850 ) //���ͼ���518����������������˱�־ + { + bFilt = 0; + } + +#ifdef SMSCENTER_DGSB //��ݸ�籣 + bFilt = 0; +#endif + + //�ж��Ƿ�Ϊ�Ŷη��ͣ���Ҫ��� + /* + if ( true ) + { + CString strMobiles = Mobiles; + strMobiles+=CString(_T(",")); //���Ӷ�һ���ռ�¼ + long lLen = strMobiles.GetLength(); + TCHAR szMobile[32]={0}; + long lMobileLen=0; + CStringSort sort; + for ( int i=0 ; i<lLen ; i++ ) + { + TCHAR c = strMobiles.GetAt(i); + if ( c=='\r' || c=='\n' || c=='\t' + || c==';' || c=='��' + || c==',' || c=='��' + || c=='.' || c=='��' + || c==':' || c=='��' + || c==' ' || c=='��' + || i == lLen-1) + { + if ( lMobileLen>=9 && lMobileLen<=18 ) //�����ĺ��볤�� + { + TCHAR szBuf[32]={0}; + _tcscpy(szBuf , szMobile); + CSendPub::ExMobileGZM(szBuf); + if ( CSendPub::isNumSup2(szBuf) ) + { + sort.Add(szBuf,true); + lMobileLen = 0; //���й������¿�ʼ + memset(szMobile , 0 , sizeof(szMobile)); + } + } + else + { + lMobileLen = 0; //���й������¿�ʼ + memset(szMobile , 0 , sizeof(szMobile)); + } + } + else + { + if ( c>='0' && c<='9' && lMobileLen<19 ) + { + szMobile[lMobileLen] = c; + lMobileLen ++; + } + } + } + //���ع��� + //���Ӻ��볬10�� + //9λ�Ŷγ�30�� + //8λ�Ŷγ�300�� + long lLX1=10; + long lLX2=30; + long lLX3=300; + + BOOL bLX = false; + long lMobileCount2=sort.GetCount(); + LONGLONG lLXOldMobile1=0; + LONGLONG lLXOldMobile2=0; + LONGLONG lLXOldMobile3=0; + long lLXCount1=0; + long lLXCount2=0; + long lLXCount3=0; + for ( int i=0 ; i<lMobileCount2 ; i++ ) + { + CString strMobile = sort.GetAt(i); + + //�ж����Ӻ��� + if ( (LONGLONG)(_ttof(strMobile)) != lLXOldMobile1+1 ) + { + lLXCount1 = 0; + lLXOldMobile1 = (LONGLONG)(_ttof(strMobile)); + } + else + { + lLXOldMobile1 = lLXOldMobile1+1; + lLXCount1 += 1; + if ( lLXCount1 >= lLX1 ) + { + bLX = true; + break; + } + } + //�ж�ǰ9λ���� + if ( (LONGLONG)(_ttol(strMobile)/1000000000) != lLXOldMobile2 ) + { + lLXCount2 = 0; + lLXOldMobile2 = (long)(_ttol(strMobile)/1000000000); + } + else + { + lLXCount2 += 1; + if ( lLXCount2 >= lLX2 ) + { + bLX = true; + break; + } + } + //�ж�ǰ8λ���� + if ( (LONGLONG)(_ttol(strMobile)/100000000) != lLXOldMobile3 ) + { + lLXCount3 = 0; + lLXOldMobile3 = (long)(_ttol(strMobile)/100000000); + } + else + { + lLXCount3 += 1; + if ( lLXCount3 >= lLX3 ) + { + bLX = true; + break; + } + } + } + + if ( bLX ) + { + bFilt = 1; + + m_strSendRet=_T("-101,���ܰ��Ŷν��з��ͣ�����ֹͣ!"); + return S_OK; + } + } + */ + //�Ƚ����ݷֶ� + //����ֶ� + CStringArray saMsg; + //�ж��Ƿ���Ҫ�ֶη��� + TCHAR szSrcMsg[2048]={0}; + _tcscpy(szSrcMsg , strMsg); + + long lMsgAll=0; + long lMsgIndex = 1; + BOOL bGetMsg2; + TCHAR szSendMsg1[512]={0}; + TCHAR szSendMsg2[512]={0}; + long lMaxSendLen = MSG_MAXSENDLEN; + + long lZDCMLen = 0; +#if defined(SMSCENTER_NX) && !defined(SMSCENTER_GDDX) //ũ���Դ�ǩ��6���� + lZDCMLen = 6; +#endif +#if defined(SMSCENTER_NX) && defined(SMSCENTER_DGSB) //�籣�ֵ�ǩ��������7���� + lZDCMLen = 6; //ǩ���ǡ���ݸ���硿 +#endif + ANS_GetTD2Data td={0}; + if ( CSendPub::GetTDPro(&AdoRS,szSmsTD,td,MOBILE_TYPE_CMCC)) //ȡ����ҵ�����õ�ͨ�����ԣ����Ƿ�Ҫ�������� + { + if ( td.lContentLen>10 && td.lContentLen<70 ) + lZDCMLen = MSG_MAXSENDLEN-td.lContentLen; + } + lMaxSendLen = lMaxSendLen-lZDCMLen; + + long lSignLen = 0; +#ifdef UNICODE + lSignLen = _tcslen(strCM); +#else + lSignLen = MultiByteToWideChar( CP_ACP,NULL,userPro.szCM,_tcslen(userPro.szCM), NULL,0); +#endif + if ( lSignLen>0 ) + lSignLen = lSignLen+2; //�������� + long lMsgLen =0; +#ifdef UNICODE + lMsgLen = _tcslen(szSrcMsg); +#else + lMsgLen = MultiByteToWideChar( CP_ACP,NULL,szSrcMsg,_tcslen(szSrcMsg), NULL,0); +#endif + //�ж��Ƿ��Գ����ŷ�ʽ���� + BOOL bLongSms=false; + if ( lLongSms>0 ) + bLongSms = true; + //�ж��Ƿ��Էֶη�ʽ���� + BOOL bFD=false; + /* + if ( lFD>0 && !bLongSms) //���dz����Ų��ֶܷ� + bFD = true; + */ + //��ʱ�����÷ֶι��ܡ�lFD����ֶ�����ǩ��ǰ�� + + BOOL bSignFront = false; + if (lFD > 0) + bSignFront = true; + + long lRand=0; //����������������� + if ( lMsgLen+lSignLen<=lMaxSendLen ) //����������һ������ʹ�dz����ŷ�ʽ������ͨ���� + { + bLongSms = false; + bFD = false; + } + if ( bLongSms && lSignLen>0) //�Գ����ŷ�ʽ���ͣ�����ǩ�� + { + /* + if (bSignFront) //ǩ��ǰ�� + { + CString strSignTemp; + strSignTemp.Format(_T("[%s]%s"), strCM, szSrcMsg); + _tcscpy(szSrcMsg, strSignTemp); + } + else + { + _tcscat(szSrcMsg, _T("[")); + _tcscat(szSrcMsg, strCM); + _tcscat(szSrcMsg, _T("]")); + } + */ + //ͳһǰ��ǩ�� + CString strSignTemp; + strSignTemp.Format(_T("��%s��%s"), strCM, szSrcMsg); + _tcscpy(szSrcMsg, strSignTemp); + } + if ( !bLongSms ) //������dz�����,������Ҫǩ��������ÿ�����ż�ǩ������ + { + lMaxSendLen = lMaxSendLen-lSignLen; + if ( bFD ) + lMaxSendLen = lMaxSendLen-4; //�ֶα�ʶ + } + else + { + lMaxSendLen = MSG_MAXSENDLEN-3; + } + while ( true ) + { + memset( szSendMsg2 , 0 , sizeof(szSendMsg2) ); + //if ( isChinese( szSrcMsg,_tcslen(szSrcMsg) ) ) + //{ + bGetMsg2 = GetSpiltUnicodeMsg( szSrcMsg , szSendMsg1 , lMsgIndex , lMaxSendLen ,lMsgAll); + //} + //else + //{ + // bGetMsg2 = GetSpiltAsciiMsg( szSrcMsg , szSendMsg2 , lMsgIndex , MSG_MAXSENDLEN*2+MSG_MAXSENDLEN*2/7 ,lMsgAll); + //} + if ( bGetMsg2 ) + { + if ( !bLongSms && lSignLen>0 ) //���dz����ţ���Ҫ��ǩ�� + { + /* + if (bSignFront) //ǩ��ǰ�� + { + CString strSignTemp; + strSignTemp.Format(_T("[%s]%s"), strCM, szSendMsg1); + _tcscpy(szSendMsg1, strSignTemp); + } + else + { + _tcscat(szSendMsg1, _T("[")); + _tcscat(szSendMsg1, strCM); + _tcscat(szSendMsg1, _T("]")); + } + */ + //ͳһǰ��ǩ�� + CString strSignTemp; + strSignTemp.Format(_T("��%s��%s"), strCM, szSendMsg1); + _tcscpy(szSendMsg1, strSignTemp); + } + saMsg.Add(szSendMsg1); + } + else + { + break; + } + lMsgIndex ++; + } + + if ( lZDCMLen >0 ) //���Դ�ǩ�� + { + if ( bLongSms && saMsg.GetSize()>0) + { + strSelect = saMsg.GetAt(saMsg.GetSize()-1); //���һ������ + +#ifdef UNICODE + lMsgLen = _tcslen(strSelect); +#else + lMsgLen = MultiByteToWideChar( CP_ACP,NULL,strSelect,_tcslen(strSelect), NULL,0); +#endif + + if ( lMsgLen>lMaxSendLen-lZDCMLen ) + { + saMsg.Add(CString(_T("��"))); //�Ӷ�һ����������ǩ�� + } + } + } + + lMsgAll = saMsg.GetSize(); + if ( lMsgAll<=0 || lMsgAll>=15 ) + { + m_strSendRet.Format(_T("-14,�������ݳ��Ȳ�����Ҫ��,%d��!"),lMsgAll); + return S_OK; + } +/* + //�������������� + CSqlPool XYSqlPool; //���������жϺ����Ƿ�ͨ + TCHAR buf[MAX_PATH+1]; + DWORD res = GetModuleFileName(AfxGetInstanceHandle(), buf, MAX_PATH); + int j=lstrlen(buf); + int iXCount=0; + for ( ; j>0 ; j-- ) + { + if (buf[j]=='\\' ) + { + iXCount ++; + if ( iXCount>=2) + break; + } + } + if ( j>0 ) + buf[j+1]=0; + _tcscat( buf , _T("XYSerup.xml") ); + + CMarkup xml; + if ( xml.Load(buf) ) + { + CString strEnable,strSQLServer,strSQLDB,strSQLUser,strSQLPasswd,strSQLMaxConnection; + if ( xml.FindElem(_T("/Setup/Enable")) ) + strEnable = xml.GetData(); + if ( xml.FindElem(_T("/Setup/XYServer/DBServer")) ) + strSQLServer = xml.GetData(); + if ( xml.FindElem(_T("/Setup/XYServer/DBName")) ) + strSQLDB=xml.GetData(); + if ( xml.FindElem(_T("/Setup/XYServer/DBUser")) ) + strSQLUser=xml.GetData(); + if ( xml.FindElem(_T("/Setup/XYServer/DBPasswd")) ) + strSQLPasswd=xml.GetData(); + if ( xml.FindElem(_T("/Setup/XYServer/MaxConnection")) ) + strSQLMaxConnection=xml.GetData(); + BOOL bEnable = _ttol(strEnable); + long lSqlCount=_ttol(strSQLMaxConnection); + if ( lSqlCount<1 || lSqlCount>20 ) + lSqlCount=5; + XYSqlPool.SetTimeOut(5,5);//���ó�ʱʱ�䣬���̡� + if (bEnable && XYSqlPool.Init(lSqlCount,strSQLServer,strSQLUser,strSQLPasswd,strSQLDB)) + { + + } + else + { + bEnableXY=false; + } + + } +*/ + + //InitRand(); //��ʼ�����������ֹ�ظ� + + long lMaxSendCount=50; //ÿ������50�� + + //long lZDSmsCount=lMsgAll * lMaxSendCount; //����Ӧ�ÿ۷����� + long lSendCount = lMaxSendCount * lMsgAll; + ANS_SendData2 * pSmsData = new ANS_SendData2[lSendCount]; + memset(pSmsData , 0 , sizeof(ANS_SendData2)*lSendCount); + + //���ڼ�¼���һ����λ�� + long * pSmsIDIndex = new long[lMaxSendCount]; + memset(pSmsIDIndex , 0,sizeof(long)*lMaxSendCount); + + //ȡ�ֻ����� + /*CString*/ strMobiles = Mobiles; + strMobiles+=CString(_T(",")); //���Ӷ�һ���ռ�¼ + long lLen = strMobiles.GetLength(); + TCHAR szMobile[32]={0}; + long lMobileLen=0; + long lMobileAllCount=0; + long lMobileCount=0; + long lMobileIndex=0; + long lMsgIDCount=0; + BOOL bSendBreak=false; + for ( int i=0 ; i<lLen ; i++ ) + { + TCHAR c = strMobiles.GetAt(i); + if ( c=='\r' || c=='\n' || c=='\t' + || c==';' || c=='��' + || c==',' || c=='��' + || c=='.' || c=='��' + || c==':' || c=='��' + || c==' ' || c=='��' + || i == lLen-1) + { + if ( lMobileLen>=9 && lMobileLen<=18 ) //�����ĺ��볤�� + { + TCHAR szBuf[32]={0}; + _tcscpy(szBuf , szMobile); + CSendPub::ExMobileGZM(szBuf); + if ( CSendPub::isNumSup2(szBuf) ) + { + pSmsData[lMobileIndex].lCorpID = lCorpID; + pSmsData[lMobileIndex].lUserID = lUserID; + if ( bFilt ) //��Ҫ��˵Ķ��� + pSmsData[lMobileIndex].lStatus = SEND_STATUS_SUB_FILT; + _tcsncpy( pSmsData[lMobileIndex].szSendNum , strAddNum ,10); //��չ�� + _tcscpy( pSmsData[lMobileIndex].szMobile , szBuf ); + _tcscpy( pSmsData[lMobileIndex].szName , strRecver ); + if ( tTimer.GetStatus() == COleDateTime::valid ) //��ʱʱ�� + { + tTimer.GetAsSystemTime(pSmsData[lMobileIndex].tTimer ); + } + + lRand = rand()%254; + if ( lRand<0 ) + lRand=-lRand; + for ( int h=1 ; h<=lMsgAll ; h++ ) + { + if ( h>1 ) + { + pSmsData[lMobileIndex] = pSmsData[lMobileIndex-1]; //�������ݵ�����������������⸴��ǰһ��������������� + } + if ( bLongSms ) + { + _stprintf( pSmsData[lMobileIndex].szMsg , _T("����%02X%X%X:%s") , lRand,lMsgAll,h,saMsg.GetAt(h-1)); + } + else + { + if ( bFD ) + _stprintf( pSmsData[lMobileIndex].szMsg , _T("%X/%X:%s") , h,lMsgAll,saMsg.GetAt(h-1)); + else + _tcscpy(pSmsData[lMobileIndex].szMsg , saMsg.GetAt(h-1) ); + + } + pSmsData[lMobileIndex].tOvrTime.wSecond = lRand; + pSmsData[lMobileIndex].tOvrTime.wDayOfWeek =(WORD)(h*100+lMsgAll); + + lMobileIndex ++; + if ( lMobileIndex >= lSendCount ) + break; + } + pSmsIDIndex[lMobileCount] = lMobileIndex-1; //��¼ÿ����������λ�� + + lMobileCount ++; + lMobileAllCount ++; + } + } + lMobileLen = 0; //���й������¿�ʼ + memset(szMobile , 0 , sizeof(szMobile)); + if ( lMobileCount>=lMaxSendCount || i== lLen-1 ) //ÿ�η�50�� + { + //��ʼ���Ͷ��� + CSendPub::SendPub_Mms Sms={0}; + + Sms.lCorpID = lCorpID; + Sms.lUserID = lUserID; + if ( tTimer.GetStatus() == COleDateTime::valid ) //��ʱʱ�� + { + tTimer.GetAsSystemTime(Sms.tTimer ); + } + _tcscpy(Sms.szIP , strIP); + Sms.lPriority = 0; //��SubmitMms�������ȼ� + if ( Sms.lPriority>10 ) + { + if ( bSDK ) + Sms.lSendCount = 2000+Sms.lPriority*500; //�ӿڷ��͵ģ�5000��� + else + Sms.lSendCount = 10000+Sms.lPriority*500; //�ӿڷ��͵ģ�5000��� + } + + //Sms.lPriority = 0; //��SubmitMms�������ȼ� + Sms.lSendCount = lMobileAllCount; //�ܶ��ŷ����������ڼ��㷢������ + //Sms.tTimer = pSendData->tTimer; + Sms.bFirstCheckYE = true; //Ԥ�ȼ��������ʱ������ + if ( bSDK ) + Sms.bWebReq = true; + +/* + Sms.XY.bEnableXY = false; + if ( bEnableXY) + { + Sms.XY.bEnableXY = true; + Sms.XY.pSQLPool = &XYSqlPool; + } +*/ + + long lRet = CSendPub::SubmitSms(Sms, pSmsData,lMobileIndex,strErrMsg,&AdoRS,&AdoRS2); + + if ( lRet>0 ) + { + *pSendCount = *pSendCount + lRet; + if ( bSDK ) + { + //����Ϊȡ���һ�����ŵ�ID + for ( int i=0 ; i<lMobileCount ; i++ ) + { + if ( pSmsIDIndex[i]>=0 && pSmsIDIndex[i]<lMobileIndex ) + { + long lSmsID = pSmsData[pSmsIDIndex[i]].lSendID; + str.Format(_T("%d") , lSmsID); + if ( strMsgID.GetLength()>0 ) + strMsgID=strMsgID+CString(_T(","))+str; + else + strMsgID = str; + + lMsgIDCount ++; + } + } + } + } + else + { + bSendBreak = true; //�����ж� + break; + } + + lMobileCount = 0; + lMobileIndex = 0; + } + } + else + { + if ( c>='0' && c<='9' && lMobileLen<19 ) + { + szMobile[lMobileLen] = c; + lMobileLen ++; + } + } + } + + if ( bSendBreak ) + { + if ( bSDK ) + m_strSendRet.Format(_T("%d,%s:%s"),lMsgIDCount,strMsgID,strErrMsg); + else + m_strSendRet.Format(_T("���Ͷ�����ɣ����ύ%d����\\n�쳣��Ϣ:%s") , *pSendCount,strErrMsg); + } + else + { + if ( bSDK ) + m_strSendRet.Format(_T("%d,%s"),lMsgIDCount,strMsgID); + else + m_strSendRet.Format(_T("���Ͷ�����ɣ����ύ%d����") , *pSendCount); + } + + AdoRS.Close(); + AdoRS2.Close(); + +#ifndef SMSCENTER_DGSB + if (strRecver != CString(_T("WebSDK")) && strRecver != CString(_T("WebSDK2")) && strRecver != CString(_T("WebF")) && strRecver != CString(_T("Web3"))) + { + //ÿ����һ����������Ҫ��40�� + while (GetTickCount() - lSendAllTime < 1 * 1000) + { + Sleep(100); + } + } +#endif + + delete pSmsData; + delete pSmsIDIndex; + return S_OK; + } + catch(...) + { + *pSendCount = -2; + return S_OK; + } + + + return S_OK; +} + + +STDMETHODIMP CSms::get_SendRet(BSTR* pVal) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + *pVal = ::SysAllocString(m_strSendRet); + + return S_OK; +} + + +STDMETHODIMP CSms::put_SendRet(BSTR newVal) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + // TODO: �ڴ�����ʵ�ִ��� + + return S_OK; +} + + +STDMETHODIMP CSms::SendSms_Excel(IDispatch* pAdoConnect, LONG lCorpID, LONG lUserID, LONG lLongSms,LONG lFD, BSTR Timer2, BSTR IP, BSTR ExcelFileName, LONG* lSendCount) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + *lSendCount = 0; + try + { + CAdoConnection adoConnection; + CAdoRecordSet AdoRS; + + if ( !adoConnection.ConnectExcel(ExcelFileName) ) + { + m_strSendRet.Format(_T("����Excel�ļ�ʧ�ܣ�%s"),ExcelFileName); + return S_OK; + } + AdoRS.SetAdoConnection(&adoConnection); + CString str; + str = _T("select * from [Sheet1$]"); + AdoRS.Open(str); + while(!AdoRS.IsEOF() ) + { + + + AdoRS.MoveNext(); + } + } + catch(...) + { + *lSendCount = -2; + return S_OK; + } + return S_OK; +} + + +STDMETHODIMP CSms::CorpSmsHttpReq(BSTR pReq, BSTR pIPAddr, BSTR pReqVer, BSTR* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + CString REQHEAD1=_T("MOBSETGATEWAY001"); + CString REQHEAD2=_T("MOBSETGATEWAY002"); + CString SMS_PIPE=_T("\\\\.\\PIPE\\SMSPIPE"); + if ( CString(pReqVer) == CString(_T("W")) ) + SMS_PIPE=_T("\\\\.\\PIPE\\SMSPIPEW"); + + + long lLen = SysStringLen(pReq)*2+2048; + TCHAR * szReq = new TCHAR[lLen]; + char * szReq2= new char[lLen]; + memset(szReq,0,lLen); + memset(szReq2,0,lLen); + _tcscpy(szReq , pReq);//ȡ������ͷ + + TCHAR szReqHead[128]={0}; + CString strRet; + //strcpy( szRet , "ERROR" ); + strRet.Format(_T("ERROR:Len=%d"),lLen-32); + + long lSendCount=0; //ȡ��Ҫ���͵��ֽ��� + long lReqVer=1; + if ( !_tcsncmp(szReq,REQHEAD1,_tcslen(REQHEAD1)) ) //�ж��Ƿ�������ͷ + { + _tcscpy(szReqHead,REQHEAD1); + lReqVer = 1; //��һ�� + lSendCount = HexToAsciiA(szReq+_tcslen(szReqHead),szReq2); + } + else + if ( !_tcsncmp(szReq,REQHEAD2,_tcslen(REQHEAD2)) ) //�ж��Ƿ�������ͷ + { + _tcscpy(szReqHead,REQHEAD2); + lReqVer = 2; //�ڶ��� + + TCHAR szTemp[64]={0}; + _tcsncpy(szTemp,szReq+_tcslen(szReqHead),10); + long lSendCount2 = _ttol(szTemp)/2; + lSendCount = HexToAsciiA(szReq+_tcslen(szReqHead)+10,szReq2); + if ( lSendCount2 != lSendCount ) + memset(szReqHead,0,sizeof(szReqHead)); + } + if ( _tcslen(szReqHead)>2 ) + { + + //���ӹܵ� + if (WaitNamedPipe(SMS_PIPE, 2000)) + //if ( true ) + { + HANDLE hPipe=CreateFile(SMS_PIPE,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); + if(hPipe!=INVALID_HANDLE_VALUE) + { + //DWORD dwMode=PIPE_TYPE_BYTE|PIPE_NOWAIT; + //SetNamedPipeHandleState(hPipe,&dwMode,NULL,NULL); //��ɷ�����ģʽ + //����Ϣ���ͳ�ȥ + tagPipeSend PipeSend={0}; + _tcscpy(PipeSend.szIP , pIPAddr); + PipeSend.lDataLen = lSendCount; + DWORD dwWrite=0; + WriteFile(hPipe, &PipeSend, sizeof(PipeSend), &dwWrite, NULL); + + //�������� + long lWrite=0; + DWORD dwTime2 = ::GetTickCount(); + while ( true ) + { + WriteFile(hPipe,szReq2+lWrite,lSendCount-lWrite,&dwWrite,NULL); + lWrite=lWrite+dwWrite; + if ( lWrite>=lSendCount ) + break; + Sleep(20); + if ( ::GetTickCount() - dwTime2 > 50000 ) //30����ղ������ݣ����س�ʱ + { + break; + } + } + //WriteFile(hPipe, szReq2, lSendCount, &dwWrite, NULL); + + //��ȡ������Ϣ + memset(&PipeSend,0,sizeof(PipeSend)); + long lRecvAllLen=0; + long lRecvLen=0; + BYTE * pData=NULL; + DWORD dwTime = ::GetTickCount(); + DWORD dwRead=0; + while ( true ) + { + dwRead=0; + if ( lRecvAllLen==0 ) //���ܳ��� + { + if ( ReadFile(hPipe,((char*)&PipeSend)+lRecvLen,sizeof(PipeSend)-lRecvLen,&dwRead,NULL)) //ȡ�����ݵij��� + { + lRecvLen = lRecvLen + dwRead; + if ( lRecvLen == sizeof(PipeSend) ) + { + lRecvAllLen = PipeSend.lDataLen; + if ( lRecvAllLen<=0 ) //���յ����������� + { + strRet += CString(_T("ERR:RecvRetError")); + break; + } + else + { + if ( pData ) + delete pData; + pData = new BYTE[lRecvAllLen+2048]; + memset(pData,0,lRecvAllLen+2048); + } + lRecvLen = 0; + } + } + } + else + { + if ( ReadFile(hPipe,pData+lRecvLen,lRecvAllLen-lRecvLen,&dwRead,NULL)) //ȡ�����ݵij��� + { + lRecvLen = lRecvLen + dwRead; + if ( lRecvLen == lRecvAllLen ) + { + //���ͷ������� + long lRetSize=_tcslen(szReqHead)+lRecvAllLen+32; + TCHAR * pRetH=new TCHAR[lRetSize*2];memset(pRetH,0,sizeof(TCHAR)*lRetSize*2); + TCHAR * pRetH2=pRetH; + _tcscpy(pRetH2,szReqHead);pRetH2=pRetH2+_tcslen(szReqHead); + + AsciiToHexW((char*)pData,pRetH2,lRecvAllLen); +#ifdef _DEBUG + CString strFileName; + strFileName.Format(_T("d:\\Http_Ret_%d.txt"),GetTickCount()); + CFile file(strFileName , CFile::modeCreate|CFile::modeReadWrite); + file.Write(CW2A(pRetH) , strlen(CW2A(pRetH))); + file.Close(); +#endif + *pRet = ::SysAllocString(pRetH); + + if ( pData ) + delete pData; + delete pRetH; + delete szReq; + delete szReq2; + return S_OK; + + } + } + } + Sleep(50); + //if ( ::GetTickCount() - dwTime >35000 ) //35���ڽ��ղ������ݣ���ʱ + if ( ::GetTickCount() - dwTime >35000 ) //35���ڽ��ղ������ݣ���ʱ + { + strRet = strRet + _T("ERR:TimeOut"); + break; + } + + } + + if ( pData ) + delete pData; + } + else + { + DWORD dw=::GetLastError(); + strRet.Format(_T("ERR:Pipe02,%d"),dw); + } + + } + else + { + strRet = _T("ERR:Pipe01"); + } + } + + + *pRet = ::SysAllocString(strRet); + delete szReq; + delete szReq2; + + return S_OK; +} + + + + +STDMETHODIMP CSms::CheckPasswd3(LONG CorpID, BSTR User, BSTR Passwd, BSTR TimeStamp, BSTR Encrypt, LONG Purview, BSTR* pRet) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + CString strRet; + + + //ȡ��User ,Passwd + char szUser[64] = { 0 }; + char szPasswd[128] = { 0 }; + char szPasswd2[128] = { 0 }; + char szEncrypt[128] = { 0 }; + TCHAR szPasswdU2[128] = { 0 }; + strcpy(szUser, CW2A(User)); + strcpy(szPasswd, CW2A(Passwd)); + strcpy(szEncrypt, CW2A(Encrypt)); + + CDes des; + long lOut = sizeof(szPasswd2); + des.Decrypt(szEncrypt, (long)strlen(szEncrypt), szPasswd2, lOut, szUser, 8); + _tcscpy(szPasswdU2, CA2W(szPasswd2)); + + CString strCorpID; + strCorpID.Format(_T("%d"), CorpID); + CString strPasswd2 = szPasswdU2; + CString strTimeStamp = TimeStamp; + + CString strMd5 = Passwd; + strMd5.MakeUpper(); + + CString strMd52 = CSendPub::GetMD5(strCorpID + strPasswd2 + strTimeStamp, false); + strMd52.MakeUpper(); + + strRet = strMd52; + + if (strMd5 == strMd52) + { + strRet = CString(_T("1")); + } + else + { + strRet = CString(_T("0")); + } + + if (!(Purview&PURVIEW_LOGIN)) + { + strRet = CString(_T("-1")); + + } + if (!(Purview&PURVIEW_SENDP)) + { + strRet = CString(_T("-1")); + } + + *pRet = ::SysAllocString(strRet); + return S_OK; +} diff --git a/Sms.h b/Sms.h new file mode 100644 index 0000000..6dccd34 --- /dev/null +++ b/Sms.h @@ -0,0 +1,76 @@ +// Sms.h : CSms ������ + +#pragma once +#include "resource.h" // ������ + + + +#include "MobsetWeb_i.h" + + + +#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) +#error "Windows CE ƽ̨(�粻�ṩ��ȫ DCOM ֧�ֵ� Windows Mobile ƽ̨)������ȷ֧�ֵ��߳� COM ������ _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA ��ǿ�� ATL ֧�ִ������߳� COM ����ʵ�ֲ�����ʹ���䵥�߳� COM ����ʵ�֡�rgs �ļ��е��߳�ģ���ѱ�����Ϊ��Free����ԭ���Ǹ�ģ���Ƿ� DCOM Windows CE ƽ̨֧�ֵ�Ψһ�߳�ģ�͡�" +#endif + +using namespace ATL; + + +// CSms + +class ATL_NO_VTABLE CSms : + public CComObjectRootEx<CComSingleThreadModel>, + public CComCoClass<CSms, &CLSID_Sms>, + public IDispatchImpl<ISms, &IID_ISms, &LIBID_MobsetWebLib, /*wMajor =*/ 1, /*wMinor =*/ 0> +{ +public: + CString m_strSendRet; + CAdoConnection m_AdoConnection; +public: + CSms() + { + } + void GetCurrentPath(TCHAR *pPath); + +DECLARE_REGISTRY_RESOURCEID(IDR_SMS) + + +BEGIN_COM_MAP(CSms) + COM_INTERFACE_ENTRY(ISms) + COM_INTERFACE_ENTRY(IDispatch) +END_COM_MAP() + + + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + HRESULT FinalConstruct() + { + return S_OK; + } + + void FinalRelease() + { + } + +public: + + + + STDMETHOD(CheckPasswd)(BSTR User, BSTR Passwd, BSTR Encrypt, LONG Purview, LONG* pRet); + STDMETHOD(CheckPasswd2)(LONG CorpID,BSTR User, BSTR Passwd, BSTR TimeStamp, BSTR Encrypt, LONG Purview, LONG* pRet); + STDMETHOD(GetPasswd)(BSTR User, BSTR Passwd, BSTR* pRet); + STDMETHOD(DePasswd)(BSTR User, BSTR Passwd, BSTR* pRet); + STDMETHOD(EncSPMS)(BSTR Key, BSTR Src, BSTR* pRet); + STDMETHOD(GetPurview)(LONG PurviewType, LONG* pRet); + STDMETHOD(HasSWTPre)(LONG lSDK, LONG* pRet); + STDMETHOD(isHasPurview)(LONG Purview, LONG AllPurview, LONG* pRet); + STDMETHOD(SendSms)(IDispatch* pAdoConnect, LONG lCorpID, LONG lUserID, LONG lLongSms,LONG lFD, BSTR Timer, BSTR IP, BSTR AddNum, BSTR Recver, BSTR Mobiles, BSTR Msg, LONG* pSendCount); + STDMETHOD(get_SendRet)(BSTR* pVal); + STDMETHOD(put_SendRet)(BSTR newVal); + STDMETHOD(SendSms_Excel)(IDispatch* pAdoConnect, LONG lCorpID, LONG lUserID, LONG lLongSms,LONG lFD, BSTR Timer2, BSTR IP, BSTR ExcelFileName, LONG* lSendCount); + STDMETHOD(CorpSmsHttpReq)(BSTR pReq, BSTR pIPAddr, BSTR pReqVer, BSTR* pRet); + STDMETHOD(CheckPasswd3)(LONG CorpID, BSTR User, BSTR Passwd, BSTR TimeStamp, BSTR Encrypt, LONG Purview, BSTR* pRet); +}; + +OBJECT_ENTRY_AUTO(__uuidof(Sms), CSms) diff --git a/Sms.rgs b/Sms.rgs new file mode 100644 index 0000000..2a5ab08 --- /dev/null +++ b/Sms.rgs @@ -0,0 +1,26 @@ +HKCR +{ + MobsetWeb.Sms.1 = s 'Sms Class' + { + CLSID = s '{A42502DF-7605-4D99-9F32-FFE224DF5571}' + } + MobsetWeb.Sms = s 'Sms Class' + { + CurVer = s 'MobsetWeb.Sms.1' + } + NoRemove CLSID + { + ForceRemove {A42502DF-7605-4D99-9F32-FFE224DF5571} = s 'Sms Class' + { + ProgID = s 'MobsetWeb.Sms.1' + VersionIndependentProgID = s 'MobsetWeb.Sms' + ForceRemove Programmable + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + TypeLib = s '{926542BC-66DD-4977-8850-E29198DDE624}' + Version = s '1.0' + } + } +} diff --git a/XYSerup.xml b/XYSerup.xml new file mode 100644 index 0000000..9a08198 --- /dev/null +++ b/XYSerup.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" ?> +<Setup> + <Enable>1</Enable> +<XYServer> + <DBServer>61.144.122.66,1444</DBServer> + <DBName>WebInfoDB</DBName> + <DBUser>WebInfo_lu</DBUser> + <DBPasswd>lu61443</DBPasswd> + <MaxConnection>5</MaxConnection> +</XYServer> +</Setup> \ No newline at end of file diff --git a/dllmain.cpp b/dllmain.cpp new file mode 100644 index 0000000..589d6d0 --- /dev/null +++ b/dllmain.cpp @@ -0,0 +1,39 @@ +// dllmain.cpp : DllMain ��ʵ�֡� + +#include "stdafx.h" +#include "resource.h" +#include "MobsetWeb_i.h" +#include "dllmain.h" +#include "xdlldata.h" + +CMobsetWebModule _AtlModule; + +class CMobsetWebApp : public CWinApp +{ +public: + +// ��д + virtual BOOL InitInstance(); + virtual int ExitInstance(); + + DECLARE_MESSAGE_MAP() +}; + +BEGIN_MESSAGE_MAP(CMobsetWebApp, CWinApp) +END_MESSAGE_MAP() + +CMobsetWebApp theApp; + +BOOL CMobsetWebApp::InitInstance() +{ +#ifdef _MERGE_PROXYSTUB + if (!PrxDllMain(m_hInstance, DLL_PROCESS_ATTACH, NULL)) + return FALSE; +#endif + return CWinApp::InitInstance(); +} + +int CMobsetWebApp::ExitInstance() +{ + return CWinApp::ExitInstance(); +} diff --git a/dllmain.h b/dllmain.h new file mode 100644 index 0000000..6a188c0 --- /dev/null +++ b/dllmain.h @@ -0,0 +1,10 @@ +// dllmain.h : ģ����������� + +class CMobsetWebModule : public ATL::CAtlDllModuleT< CMobsetWebModule > +{ +public : + DECLARE_LIBID(LIBID_MobsetWebLib) + DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MOBSETWEB, "{5404DFF5-7C6C-424E-9ADE-1C5B775C22D7}") +}; + +extern class CMobsetWebModule _AtlModule; diff --git a/resource.h b/resource.h new file mode 100644 index 0000000..73e2a90 Binary files /dev/null and b/resource.h differ diff --git a/stdafx.cpp b/stdafx.cpp new file mode 100644 index 0000000..b4f22d1 --- /dev/null +++ b/stdafx.cpp @@ -0,0 +1,5 @@ +// stdafx.cpp : ֻ�����������ļ���Դ�ļ� +// MobsetWeb.pch ����ΪԤ����ͷ +// stdafx.obj ������Ԥ����������Ϣ + +#include "stdafx.h" diff --git a/stdafx.h b/stdafx.h new file mode 100644 index 0000000..1b95bdd --- /dev/null +++ b/stdafx.h @@ -0,0 +1,64 @@ +// stdafx.h : ��ϵͳ�����ļ��İ����ļ��� +// ���Ǿ���ʹ�õ��������ĵ� +// �ض�����Ŀ�İ����ļ� + +#pragma once + +#ifndef STRICT +#define STRICT +#endif + +/* +#define WINVER 0x0501 +#define _WIN32_WINNT 0x0501 +#define _WIN32_WINDOWS 0x0501 +*/ + +#include "targetver.h" + +#define _ATL_APARTMENT_THREADED + +#define _ATL_NO_AUTOMATIC_NAMESPACE + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // ijЩ CString ���캯��������ʽ�� + +#define _CRT_SECURE_NO_WARNINGS +#define _CRT_NON_CONFORMING_SWPRINTFS + +#include <afxwin.h> +#include <afxext.h> +#include <afxole.h> +#include <afxodlgs.h> +#include <afxrich.h> +#include <afxhtml.h> +#include <afxcview.h> +#include <afxwinappex.h> +#include <afxframewndex.h> +#include <afxmdiframewndex.h> + + +#ifndef _AFX_NO_OLE_SUPPORT +#include <afxdisp.h> // MFC �Զ����� +#endif // _AFX_NO_OLE_SUPPORT + +#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW + +#include "resource.h" +#include <atlbase.h> +#include <atlcom.h> +#include <atlctl.h> + +#include "..\public\des\Des.h" +#include "..\public\CorpSms.h" +#include "..\public\ado\Ado.h" +#include "..\public\LuTool.h" + + +typedef struct _tagPipeSend{ + int lDataLen; + TCHAR szIP[32]; + TCHAR szTemp[256]; +}tagPipeSend; + + +//#define SMSCENTER_DGSB //��ݸ�籣�汾 \ No newline at end of file diff --git a/targetver.h b/targetver.h new file mode 100644 index 0000000..7a7d2c8 --- /dev/null +++ b/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// ���� SDKDDKVer.h ��������õ���߰汾�� Windows ƽ̨�� + +// ���ҪΪ��ǰ�� Windows ƽ̨����Ӧ�ó�������� WinSDKVer.h������ +// WIN32_WINNT ������ΪҪ֧�ֵ�ƽ̨��Ȼ���ٰ��� SDKDDKVer.h�� + +#include <SDKDDKVer.h> diff --git a/xdlldata.c b/xdlldata.c new file mode 100644 index 0000000..3cee71f --- /dev/null +++ b/xdlldata.c @@ -0,0 +1,18 @@ +// dlldata.c �İ�װ + +#ifdef _MERGE_PROXYSTUB // �ϲ��������(stub) DLL + +#define REGISTER_PROXY_DLL //DllRegisterServer �� + +#define _WIN32_WINNT 0x0500 //���� WinNT 4.0 ��װ�� DCOM �� Win95 +#define USE_STUBLESS_PROXY //����ʹ�� MIDL ���� /Oicf ʱ���� + +#pragma comment(lib, "rpcns4.lib") +#pragma comment(lib, "rpcrt4.lib") + +#define ENTRY_PREFIX Prx + +#include "dlldata.c" +#include "MobsetWeb_p.c" + +#endif //_MERGE_PROXYSTUB diff --git a/xdlldata.h b/xdlldata.h new file mode 100644 index 0000000..89313c5 --- /dev/null +++ b/xdlldata.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef _MERGE_PROXYSTUB + +extern "C" +{ +BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, + LPVOID lpReserved); +STDAPI PrxDllCanUnloadNow(void); +STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv); +STDAPI PrxDllRegisterServer(void); +STDAPI PrxDllUnregisterServer(void); +} + +#endif diff --git a/调试方法.txt b/调试方法.txt new file mode 100644 index 0000000..34d041c --- /dev/null +++ b/调试方法.txt @@ -0,0 +1,5 @@ +ȷ����ǰʹ�õ���MobsetWeb/Debug�µ�ע��DLL�ļ��� + +Vs 2017�������ԡ��˵��������ӵ����̡���ѡ�С���ʾ�����û��Ľ��̡���ѡ�С�w3wp.exe���� + +�ص㣺���ӵ���ѡ�������롰��