commit 0e8c78ca5ed7d2392d15c4163032bd380e126c86 Author: Gerardo Date: Mon Apr 6 13:03:14 2020 +0200 Compilacion inicial en v2017 partiendo de la v2008 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..71f5c73 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/Debug/* +/Release/* +/x64/* +/*.aps +*.bak +/ClientLic_h.h +/ClientLic_i.c diff --git a/ClientLic.cpp b/ClientLic.cpp new file mode 100644 index 0000000..f0e55ef --- /dev/null +++ b/ClientLic.cpp @@ -0,0 +1,138 @@ +// ClientLic.cpp : Defines the initialization routines for the DLL. +// + +#include "stdafx.h" +#include "ClientLic.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +// +//TODO: If this DLL is dynamically linked against the MFC DLLs, +// any functions exported from this DLL which call into +// MFC must have the AFX_MANAGE_STATE macro added at the +// very beginning of the function. +// +// For example: +// +// extern "C" BOOL PASCAL EXPORT ExportedFunction() +// { +// AFX_MANAGE_STATE(AfxGetStaticModuleState()); +// // normal function body here +// } +// +// It is very important that this macro appear in each +// function, prior to any calls into MFC. This means that +// it must appear as the first statement within the +// function, even before any object variable declarations +// as their constructors may generate calls into the MFC +// DLL. +// +// Please see MFC Technical Notes 33 and 58 for additional +// details. +// + +// CClientLicApp + +BEGIN_MESSAGE_MAP(CClientLicApp, CWinApp) +END_MESSAGE_MAP() + + +// CClientLicApp construction + +CClientLicApp::CClientLicApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + + +// The one and only CClientLicApp object + +CClientLicApp theApp_ClientLic; + +const GUID CDECL BASED_CODE _tlid = + { 0xFA0BB9B4, 0x5506, 0x49A7, { 0xBD, 0x90, 0x75, 0xD1, 0x3A, 0x3B, 0xC5, 0xED } }; +const WORD _wVerMajor = 1; +const WORD _wVerMinor = 0; + +// CClientLicApp initialization + +BOOL CClientLicApp::InitInstance() +{ + CWinApp::InitInstance(); + + if (!AfxSocketInit()) + { + AfxMessageBox(IDP_SOCKETS_INIT_FAILED); + return FALSE; + } + hins_ClientLic=::LoadLibrary ("ClientLic.dll"); + hmod_ClientLic = ::GetModuleHandle("ClientLic.dll");//RT_BITMAP + + // Register all OLE server (factories) as running. This enables the + // OLE libraries to create objects from other applications. + COleObjectFactory::RegisterAll(); + + return TRUE; +} + +// DllGetClassObject - Returns class factory + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + return AfxDllGetClassObject(rclsid, riid, ppv); +} + + +// DllCanUnloadNow - Allows COM to unload DLL + +STDAPI DllCanUnloadNow(void) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + return AfxDllCanUnloadNow(); +} + + +// DllRegisterServer - Adds entries to the system registry + +STDAPI DllRegisterServer(void) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid)) + return SELFREG_E_TYPELIB; + + if (!COleObjectFactory::UpdateRegistryAll()) + return SELFREG_E_CLASS; + + return S_OK; +} + + +// DllUnregisterServer - Removes entries from the system registry + +STDAPI DllUnregisterServer(void) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor)) + return SELFREG_E_TYPELIB; + + if (!COleObjectFactory::UpdateRegistryAll(FALSE)) + return SELFREG_E_CLASS; + + return S_OK; +} +ClientLic_dll::ClientLic_dll(void) +{ + m_hInstOld = AfxGetResourceHandle(); + AfxSetResourceHandle(theApp_ClientLic.hmod_ClientLic); +} + +ClientLic_dll::~ClientLic_dll(void) +{ + AfxSetResourceHandle(m_hInstOld); +} \ No newline at end of file diff --git a/ClientLic.def b/ClientLic.def new file mode 100644 index 0000000..0d3d7bc --- /dev/null +++ b/ClientLic.def @@ -0,0 +1,10 @@ +; ClientLic.def : Declares the module parameters for the DLL. + +LIBRARY "ClientLic" + +EXPORTS + ; Explicit exports can go here + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff --git a/ClientLic.h b/ClientLic.h new file mode 100644 index 0000000..412c299 --- /dev/null +++ b/ClientLic.h @@ -0,0 +1,37 @@ +// ClientLic.h : main header file for the ClientLic DLL +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + + +// CClientLicApp +// See ClientLic.cpp for the implementation of this class +// + +class CClientLicApp : public CWinApp +{ +public: + CClientLicApp(); + +// Overrides +public: + virtual BOOL InitInstance(); + HINSTANCE hins_ClientLic; + HMODULE hmod_ClientLic; + DECLARE_MESSAGE_MAP() +}; +extern CClientLicApp theApp_ClientLic; + +class ClientLic_dll +{ +public: + HINSTANCE m_hInstOld; + ClientLic_dll(void); + virtual ~ClientLic_dll(void); +}; \ No newline at end of file diff --git a/ClientLic.idl b/ClientLic.idl new file mode 100644 index 0000000..e666dd5 --- /dev/null +++ b/ClientLic.idl @@ -0,0 +1,10 @@ +// ClientLic.idl : type library source for ClientLic.dll +// This file will be processed by the MIDL compiler to produce the +// type library (ClientLic.tlb). + +[ uuid(FA0BB9B4-5506-49A7-BD90-75D13A3BC5ED), version(1.0) ] +library ClientLic +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); +}; diff --git a/ClientLic.rc b/ClientLic.rc new file mode 100644 index 0000000..e696662 --- /dev/null +++ b/ClientLic.rc @@ -0,0 +1,238 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Narvaling." + VALUE "FileDescription", "Cliente del gestor de Licencias" + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "ClientLic.dll" + VALUE "LegalCopyright", "(c) Narvaling. All rights reserved." + VALUE "OriginalFilename", "ClientLic.dll" + VALUE "ProductName", "ClientLic" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Spanish resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN) +#ifdef _WIN32 +LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""res\\ClientLic.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "1 TYPELIB ""ClientLic.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG1 DIALOGEX 0, 0, 183, 58 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sin licencia" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,126,37,50,14 + LTEXT "Introduca clave de licencia para el producto:",IDC_STATIC,7,7,145,8 + EDITTEXT IDC_EDIT1,7,16,169,18,ES_PASSWORD | ES_AUTOHSCROLL +END + +IDD_DIALOG2 DIALOGEX 0, 0, 214, 215 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Nueva Versión" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Descargar",IDOK,157,193,50,14 + PUSHBUTTON "Cancel",IDCANCEL,7,193,50,14 + EDITTEXT IDC_EDIT2,17,90,74,14,ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_EDIT3,17,42,74,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "¿Desea descargar la nueva versión?",IDC_STATIC,7,7,116,8 + EDITTEXT IDC_EDIT4,115,42,74,14,ES_AUTOHSCROLL | ES_READONLY + GROUPBOX "Producto Actual",IDC_STATIC,7,27,200,40 + GROUPBOX "Nueva versión",IDC_STATIC,7,75,200,110 + EDITTEXT IDC_EDIT5,115,89,74,14,ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_EDIT6,17,116,172,64,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY +END + +IDD_DIALOG3 DIALOGEX 0, 0, 313, 100 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Error" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,256,79,50,14 + LTEXT "Static",IDC_STATIC_MSG_ERROR,7,7,299,50 +END + +IDD_DIALOG_PROG DIALOGEX 0, 0, 296, 99 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,239,78,50,14 + PUSHBUTTON "Cancel",IDCANCEL,7,78,50,14 + CONTROL "",IDC_PROGRESO_BAR,"msctls_progress32",WS_BORDER,21,18,258,14 + LTEXT "Descargando archivos...",IDC_STATIC_PROGRESO,21,47,212,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_DIALOG1, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 176 + TOPMARGIN, 7 + BOTTOMMARGIN, 51 + END + + IDD_DIALOG2, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 207 + TOPMARGIN, 7 + BOTTOMMARGIN, 207 + END + + IDD_DIALOG3, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 306 + TOPMARGIN, 7 + BOTTOMMARGIN, 93 + END + + IDD_DIALOG_PROG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 289 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Spanish resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "res\ClientLic.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif +1 TYPELIB "ClientLic.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/ClientLic.vcproj b/ClientLic.vcproj new file mode 100644 index 0000000..e88e28a --- /dev/null +++ b/ClientLic.vcproj @@ -0,0 +1,525 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ClientLic.vcproj.NELIAM.Elena.user b/ClientLic.vcproj.NELIAM.Elena.user new file mode 100644 index 0000000..c756d5e --- /dev/null +++ b/ClientLic.vcproj.NELIAM.Elena.user @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + diff --git a/ClientLic.vcproj.yandrak.Gerardo.user b/ClientLic.vcproj.yandrak.Gerardo.user new file mode 100644 index 0000000..2d1426a --- /dev/null +++ b/ClientLic.vcproj.yandrak.Gerardo.user @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + diff --git a/ClientLic.vcxproj b/ClientLic.vcxproj new file mode 100644 index 0000000..0186af2 --- /dev/null +++ b/ClientLic.vcxproj @@ -0,0 +1,303 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {22EEEE5A-0A71-4655-B57F-5FB8E1692389} + ClientLic + MFCDLLProj + + + + DynamicLibrary + v141 + Dynamic + MultiByte + true + + + DynamicLibrary + v141 + Dynamic + MultiByte + + + DynamicLibrary + v141 + Dynamic + MultiByte + true + + + DynamicLibrary + v141 + Dynamic + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28127.55 + + + $(Configuration)\ + $(Configuration)\ + true + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + + + $(Configuration)\ + $(Configuration)\ + false + + + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + _DEBUG;%(PreprocessorDefinitions) + false + Win32 + $(IntDir)ClientLic.tlb + + + Disabled + ..\licUtiles;..\utiles;..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + false + LicUtiles.lib;Utiles.lib;FileTransfer.lib;%(AdditionalDependencies) + ..\..\lib\$(Configuration);%(AdditionalLibraryDirectories) + .\ClientLic.def + true + Windows + MachineX86 + + + copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir) +copy $(OutDir)ClientLic.lib ..\lib\$(IntDir) + + + + + _DEBUG;%(PreprocessorDefinitions) + false + X64 + $(IntDir)ClientLic.tlb + + + Disabled + ..\licUtiles;..\utiles;..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + false + LicUtiles.lib;Utiles.lib;FileTransfer.lib;%(AdditionalDependencies) + ..\..\lib\x64\$(Configuration);%(AdditionalLibraryDirectories) + .\ClientLic.def + true + Windows + MachineX64 + + + copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir) +copy $(OutDir)ClientLic.lib ..\lib\$(IntDir) + + + + + NDEBUG;%(PreprocessorDefinitions) + false + Win32 + $(IntDir)ClientLic.tlb + + + MaxSpeed + true + ..\licUtiles;..\utiles;..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + Use + Level3 + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + false + LicUtiles.lib;Utiles.lib;FileTransfer.lib;%(AdditionalDependencies) + ..\..\lib\$(Configuration);%(AdditionalLibraryDirectories) + .\ClientLic.def + true + Windows + true + true + MachineX86 + + + copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir) +copy $(OutDir)ClientLic.lib ..\lib\$(IntDir) + + + + + NDEBUG;%(PreprocessorDefinitions) + false + X64 + $(IntDir)ClientLic.tlb + + + MaxSpeed + true + ..\licUtiles;..\utiles;..\TransferSrv\FileTransfer;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDLL + true + Use + Level3 + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + false + LicUtiles.lib;Utiles.lib;FileTransfer.lib;%(AdditionalDependencies) + ..\..\lib\x64\$(Configuration);%(AdditionalLibraryDirectories) + .\ClientLic.def + true + Windows + true + true + MachineX64 + + + copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir) +copy $(OutDir)ClientLic.lib ..\lib\$(IntDir) + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + {04e5b10e-5a75-48a2-857b-805659c7877d} + false + + + {30c05365-2dfc-4ad4-905e-8a414ae0d0a0} + false + + + {aa58c828-7025-4a4c-868e-76b8902af6bb} + false + + + + + + + + + + + \ No newline at end of file diff --git a/ClientLic.vcxproj.filters b/ClientLic.vcxproj.filters new file mode 100644 index 0000000..bfe6b22 --- /dev/null +++ b/ClientLic.vcxproj.filters @@ -0,0 +1,97 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {04f07e47-fb66-4ca1-8dcf-6927a793641b} + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {2de42549-0360-4df6-bb1a-7d35bbad9960} + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\Dialog + + + Source Files\Dialog + + + Source Files\Dialog + + + + + Source Files + + + Resource Files + + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\Dialog + + + Header Files\Dialog + + + Header Files\Dialog + + + Header Files\Dialog + + + + + Resource Files + + + \ No newline at end of file diff --git a/ClientLic.vcxproj.user b/ClientLic.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/ClientLic.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ClientLicDef.h b/ClientLicDef.h new file mode 100644 index 0000000..56aa9fb --- /dev/null +++ b/ClientLicDef.h @@ -0,0 +1,9 @@ +#pragma once +#ifndef CLIC_EXPORT +#ifdef _WINDLL +#define CLIC_EXPORT __declspec(dllexport) +#else +#define CLIC_EXPORT __declspec(dllimport) +#endif + +#endif diff --git a/ClientLic_h.h.orig b/ClientLic_h.h.orig new file mode 100644 index 0000000..7c0f2da --- /dev/null +++ b/ClientLic_h.h.orig @@ -0,0 +1,74 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0500 */ +<<<<<<< HEAD +/* at Sun Dec 15 02:17:21 2019 +======= +/* at Thu Dec 12 22:30:37 2019 +>>>>>>> 716b72f443d5da30d7e21daa34d5d00210d4e46d + */ +/* Compiler settings for .\ClientLic.idl: + Oicf, W1, Zp8, env=Win64 (32b run) + 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( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + + +#ifndef __ClientLic_h_h__ +#define __ClientLic_h_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifdef __cplusplus +extern "C"{ +#endif + + + +#ifndef __ClientLic_LIBRARY_DEFINED__ +#define __ClientLic_LIBRARY_DEFINED__ + +/* library ClientLic */ +/* [version][uuid] */ + + +EXTERN_C const IID LIBID_ClientLic; +#endif /* __ClientLic_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/ClientLic_i.c.orig b/ClientLic_i.c.orig new file mode 100644 index 0000000..b10a78f --- /dev/null +++ b/ClientLic_i.c.orig @@ -0,0 +1,83 @@ + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 7.00.0500 */ +<<<<<<< HEAD +/* at Sun Dec 15 02:17:21 2019 +======= +/* at Thu Dec 12 22:30:37 2019 +>>>>>>> 716b72f443d5da30d7e21daa34d5d00210d4e46d + */ +/* Compiler settings for .\ClientLic.idl: + Oicf, W1, Zp8, env=Win64 (32b run) + 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( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, LIBID_ClientLic,0xFA0BB9B4,0x5506,0x49A7,0xBD,0x90,0x75,0xD1,0x3A,0x3B,0xC5,0xED); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + diff --git a/ClienteLicencias.cpp b/ClienteLicencias.cpp new file mode 100644 index 0000000..681a6e7 --- /dev/null +++ b/ClienteLicencias.cpp @@ -0,0 +1,151 @@ +#include "StdAfx.h" +#include "ClienteLicencias.h" +#include "DescargaVersion.h" +#include "DialogKey.h" +#include "ClientLic.h" +#include "DialogError.h" +#include "licencia.h" +#include "DescargadorFiles.h" +#include "utl.h" +#include "DialogProgreso.h" +#include "dir_manager.h" +#include "_log.h" +#include "LicCliente.h" + +ClienteLicencias::ClienteLicencias(void) +{ + dias_pregun = 5; + dirLic[0]=0; + dirTemp[0]=0; +} + +ClienteLicencias::~ClienteLicencias(void) +{ +} + +void ClienteLicencias::muestaError( char* info, char* producto ) +{ + ClientLic_dll dll; + DialogError dialog; + dialog.errorSt = info; + dialog.produc = producto; + + dialog.DoModal(); + return; +} + +bool ClienteLicencias::getClave( char* clave, char* producto ) +{ + ClientLic_dll dll; + DialogKey dialog; + strcpy(dialog.producto,producto); + dialog.DoModal(); + strcpy(clave, dialog.clave); + return true; +} + +bool ClienteLicencias::descargaInstalador( Licencia *lic ) +{ + ClientLic_dll dll; + if(!preguntarDescarga()) + return true; + DescargaVersion dialog; + dialog.producActu = lic->nombre_producto; + dialog.verActu = lic->version_producto; + dialog.producNew = lic->nombre_producto; + dialog.verNew = lic->instaVersion; + dialog.desc = lic->instaDescrip; + + dialog.DoModal(); + if(dialog.descarga) + descargaVersion(lic); + return true; +} + +void ClienteLicencias::descargaVersion( Licencia *lic) +{ + DescargadorFiles cli; + StrArray buf; + Cutl::stringSplit(lic->instaServer,":",&buf); + cli.setServer(buf.get(0), + atoi(buf.get(1)), lic->instaKey,lic->instaUsu); + buf.n_i=buf.n_str =0; + buf.add(lic->instaPath); + DialogProgreso prog; + dprog = &prog; + char name[128]; + sprintf(prog.dirProgram,"%s%s",dirTemp,Cdir_manager::nombre_archivo(lic->instaPath,name)); + prog.espera = &espera_dlg; + prog.cancelar = &cancelaDescarga; + cancelaDescarga = false; + espera_dlg = true; + cli.iniciaDescarga(&buf,dirTemp,this); + prog.DoModal(); +} + +void ClienteLicencias::setStatus( double porcen ) +{ + porcen = porcen; + while(espera_dlg) + Sleep(10); + dprog->SendMessage(WMS_STATUS,(WPARAM) &porcen); +} + +void ClienteLicencias::finTransfer( bool finalFeliz ) +{ + if(finalFeliz) + porcen = 100; + else + porcen = false; + while(espera_dlg) + Sleep(10); + dprog->SendMessage(WMS_STATUS,(WPARAM) &porcen); + dprog->SendMessage(WMS_FIN,(WPARAM) finalFeliz); +} + +bool ClienteLicencias::cancelTransfer() +{ + return cancelaDescarga; +} + +bool ClienteLicencias::preguntarDescarga() +{ + char str[256]; + //revisa archivo--------------- + bool res = true; + if(!dirLic[0]) + strcpy(str, "acceso.bin"); + else + sprintf(str,"%s%s",dirLic, "acceso.bin"); + + Cb_file f; + __int64 t = CTime::GetCurrentTime().GetTime(); + if(f.abre(str,3)) + { + __int64 tult=0; + f.lee(&tult, sizeof(__int64)); + f.cierra(); + res = (tult+(dias_pregun*86400))docmsg((CMsgdoc *) lParam); + return 0 ; +} +LRESULT DialogProgreso::OnFin( WPARAM Wparam, LPARAM lParam ) +{ + //CGeofotoDoc* pdoc = (CGeofotoDoc*)GetActiveDocument(); + //pdoc->docmsg((CMsgdoc *) lParam); + if(!Wparam) + progr_text.SetWindowText("Descarga cancelada"); + else + progr_text.SetWindowText("Descarga completada"); + + ok_button.EnableWindow(Wparam!=0); + puedeSalir = true; + return 0 ; +} + +BOOL DialogProgreso::OnInitDialog() +{ + CDialog::OnInitDialog(); + + ok_button.EnableWindow(0); + puedeSalir = 0; + *espera=FALSE; + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/DialogProgreso.h b/DialogProgreso.h new file mode 100644 index 0000000..f3e1928 --- /dev/null +++ b/DialogProgreso.h @@ -0,0 +1,40 @@ +#pragma once +#include "afxcmn.h" +#include "afxwin.h" +#include "FileTransferDef.h" + + +// DialogProgreso dialog +#define WMS_STATUS (WM_USER+1) +#define WMS_FIN (WM_USER+2) + + +class FT_EXPORT DialogProgreso : public CDialog +{ + DECLARE_DYNAMIC(DialogProgreso) + +public: + DialogProgreso(CWnd* pParent = NULL); // standard constructor + virtual ~DialogProgreso(); + bool *cancelar; + bool *espera; + bool puedeSalir; + char dirProgram[256]; +// Dialog Data + enum { IDD = IDD_DIALOG_PROG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + CProgressCtrl progr_bar; + CStatic progr_text; + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedCancel(); + afx_msg LRESULT OnInfo( WPARAM, LPARAM lParam ); + afx_msg LRESULT OnFin( WPARAM, LPARAM lParam ); + + CButton ok_button; + virtual BOOL OnInitDialog(); +}; diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..e3c18ba --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,65 @@ +======================================================================== + MICROSOFT FOUNDATION CLASS LIBRARY : ClientLic Project Overview +======================================================================== + + +AppWizard has created this ClientLic DLL for you. This DLL not only +demonstrates the basics of using the Microsoft Foundation classes but +is also a starting point for writing your DLL. + +This file contains a summary of what you will find in each of the files that +make up your ClientLic DLL. + +ClientLic.vcproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +ClientLic.h + This is the main header file for the DLL. It declares the + CClientLicApp class. + +ClientLic.cpp + This is the main DLL source file. It contains the class CClientLicApp. + It also contains the OLE entry points required of inproc servers. + +ClientLic.idl + This file contains the Object Description Language source code for the + type library of your DLL. + +ClientLic.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. It includes the icons, bitmaps, and cursors that are stored + in the RES subdirectory. This file can be directly edited in Microsoft + Visual C++. + +res\ClientLic.rc2 + This file contains resources that are not edited by Microsoft + Visual C++. You should place all resources not editable by + the resource editor in this file. + +ClientLic.def + This file contains information about the DLL that must be + provided to run with Microsoft Windows. It defines parameters + such as the name and description of the DLL. It also exports + functions from the DLL. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named ClientLic.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file, which defines new resource IDs. + Microsoft Visual C++ reads and updates this file. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/res/ClientLic.rc2 b/res/ClientLic.rc2 new file mode 100644 index 0000000..2f133d2 --- /dev/null +++ b/res/ClientLic.rc2 @@ -0,0 +1,13 @@ +// +// ClientLic.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git a/resource.h b/resource.h new file mode 100644 index 0000000..96acd65 --- /dev/null +++ b/resource.h @@ -0,0 +1,29 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ClientLic.rc +// +#define IDP_SOCKETS_INIT_FAILED 101 +#define IDD_DIALOG1 4000 +#define IDC_EDIT1 4000 +#define IDD_DIALOG2 4001 +#define IDC_EDIT2 4001 +#define IDC_EDIT3 4002 +#define IDD_DIALOG3 4002 +#define IDC_EDIT4 4003 +#define IDD_DIALOG_PROG 4003 +#define IDC_EDIT5 4004 +#define IDC_EDIT6 4005 +#define IDC_PROGRESO_BAR 4007 +#define IDC_STATIC_PROGRESO 4008 +#define IDC_STATIC_MSG_ERROR 4009 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 4004 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 4010 +#define _APS_NEXT_SYMED_VALUE 4000 +#endif +#endif diff --git a/stdafx.cpp b/stdafx.cpp new file mode 100644 index 0000000..b2ff825 --- /dev/null +++ b/stdafx.cpp @@ -0,0 +1,7 @@ +// stdafx.cpp : source file that includes just the standard includes +// ClientLic.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + diff --git a/stdafx.h b/stdafx.h new file mode 100644 index 0000000..9277429 --- /dev/null +++ b/stdafx.h @@ -0,0 +1,40 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently + +#pragma once + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +#include // MFC core and standard components +#include // MFC extensions + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC OLE classes +#include // MFC OLE dialog classes +#include // MFC Automation classes +#endif // _AFX_NO_OLE_SUPPORT + +#ifndef _AFX_NO_DB_SUPPORT +#include // MFC ODBC database classes +#endif // _AFX_NO_DB_SUPPORT + +#ifndef _AFX_NO_DAO_SUPPORT +#include // MFC DAO database classes +#endif // _AFX_NO_DAO_SUPPORT + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC support for Internet Explorer 4 Common Controls +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // MFC socket extensions + diff --git a/targetver.h b/targetver.h new file mode 100644 index 0000000..11730d5 --- /dev/null +++ b/targetver.h @@ -0,0 +1,26 @@ + +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif +