// LicServer.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "LicServer.h" #include "DbLicServerFiller.h" #include "_log.h" #include "licencia.h" #include "utl.h" #include "StrArray.h" #include "AppClasSrv.h" #include "LicenciasManager.h" #include "LicCliente.h" #include "ClienteLicencias.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // The one and only application object CWinApp theApp; using namespace std; int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; AppClasSrv app; // initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { // TODO: change error code to suit your needs _tprintf(_T("Fatal Error: MFC initialization failed\n")); nRetCode = 1; } else { if(argc==1) { ClienteLicencias lic; if(!lic.cargaLicencia()) C_log::log("Main", "Error al cargar licencia"); C_log::log("Main", "Final feliz"); system("pause"); } else if(argc==2 && strstr("Server",argv[1])) { //modo servidor-------------- LicenciasManager licSrv; if(licSrv.inicia(DbLicServerFiller::Get())) { C_log::log("Main", "Servidor activo"); app.runApp(); } else C_log::log("Main", "error iniciar servidor"); system("pause"); } else if(argc>=2 && argc<=4 ) { LicCliente cli; int tipo =0; for (int i =1; ifill(&lic)) C_log::log("Main", "error en acceder a bbdd"); if(!filler->fillInstal(&lic)) C_log::log("Main", "error en acceder a bbdd"); __int64 accesodb, accesoAct; if(!filler->setAcceso(&lic, &accesodb, &accesoAct)) C_log::log("Main", "error en acceso a bbdd"); int nlic =filler->licCount(&lic); C_log::log("Main", "error en acceso a bbdd"); lic.permisos = lic.permisos;*/ } } return nRetCode; }