6a9ae2deb2
Files correlati : Ricompilazione Demo : [ ] Commento : Modificone globalone git-svn-id: svn://10.65.10.50/trunk@10895 c028cbd2-c16b-5b4b-a496-9718f37d4682
78 lines
1.4 KiB
C++
Executable File
78 lines
1.4 KiB
C++
Executable File
#define __STDTYPES_CPP
|
|
|
|
#include <applicat.h>
|
|
#include <dongle.h>
|
|
#include <prefix.h>
|
|
|
|
HIDDEN long _stdlevel = 0;
|
|
|
|
// @doc INTERNAL
|
|
|
|
// @func Ritorna il livello degli archivi
|
|
long get_std_level()
|
|
{ return _stdlevel; }
|
|
|
|
// @func Setta il livello degli archivi
|
|
void set_std_level(const long l)
|
|
{ _stdlevel = l; }
|
|
|
|
// @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 >= 1997 && 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()
|
|
{
|
|
TPrefix& pref = prefix_init();
|
|
|
|
pref.set(""); // Dati standard
|
|
_stdlevel = pref.filelevel();
|
|
pref.set("DEF"); // Ditta corrente
|
|
}
|
|
// @doc INTERNAL
|
|
|
|
// @func Dealloca le variabili globali
|
|
void free_global_vars()
|
|
{
|
|
destroy_dongle();
|
|
prefix_destroy();
|
|
}
|
|
|
|
|
|
|
|
|