ab1a9de76b
Files correlati : Ricompilazione Demo : [ ] Commento : Eliminate variabili statiche: _xvt_running -> TApplication::is_running() _stdlevel -> TPrefix::get_stdlevel() git-svn-id: svn://10.65.10.50/trunk@11147 c028cbd2-c16b-5b4b-a496-9718f37d4682
62 lines
1.1 KiB
C++
Executable File
62 lines
1.1 KiB
C++
Executable File
#define __STDTYPES_CPP
|
|
|
|
#include <applicat.h>
|
|
#include <dongle.h>
|
|
#include <prefix.h>
|
|
|
|
// @doc INTERNAL
|
|
|
|
// @func Ritorna il numero di serie della chiave
|
|
//
|
|
// @rdesc Numero di serie della chiave
|
|
int get_serial_number()
|
|
{
|
|
TDongle& din = dongle();
|
|
bool ok = din.ok();
|
|
if (!ok)
|
|
ok = din.login();
|
|
return ok ? int(din.number()) : -1;
|
|
}
|
|
|
|
bool test_assistance_year()
|
|
{
|
|
#ifndef _DEMO_
|
|
int dongle_year = TDate(TODAY).year();
|
|
|
|
if (get_serial_number() > 0)
|
|
{
|
|
const int new_year = dongle().year_assist();
|
|
if (new_year >= 2002 && new_year <= dongle_year)
|
|
dongle_year = new_year;
|
|
}
|
|
|
|
int app_year, dum1, dum2, dum3;
|
|
bool ok = TApplication::get_version_info(app_year, dum1, dum2, dum3);
|
|
if (ok)
|
|
ok = app_year <= dongle_year;
|
|
return ok;
|
|
#else
|
|
return TRUE;
|
|
#endif // _DEMO_
|
|
}
|
|
|
|
// @doc INTERNAL
|
|
|
|
// @func Inizilizza le variabili globali
|
|
void init_global_vars()
|
|
{
|
|
prefix_init();
|
|
}
|
|
// @doc INTERNAL
|
|
|
|
// @func Dealloca le variabili globali
|
|
void free_global_vars()
|
|
{
|
|
destroy_dongle();
|
|
prefix_destroy();
|
|
}
|
|
|
|
|
|
|
|
|