This file implement functions to initialzie (and shutdown) the logging, license and Calendar modules. The functions here are used by the remaining examples here.
#include <windows.h>
#include <iostream>
#include <string>
#include "SFLOG.h"
#include "SFLUC.h"
#include "SFDBM.h"
static unsigned uLOGToken=unsigned(-1);
static unsigned uLUCToken=unsigned(-1);
static unsigned uDBMToken=unsigned(-1);
const TCHAR szProdKey[] =L"31223-200-169";
const TCHAR szLicenseKey[] =L"79F7-C8-A9-01-7777";
const TCHAR szActivationCode[] =L"2c07d642fe1ef089e5517d35e15f186814e17fb80b25cd950e77ade2e63c82c65d94ca639"
"a77475d11981fd0a06e3ece730ef09c53c1f2da6d89d9a1d453d5e3678e50786a42101f19"
"4ffd543c2b72b55576fa52796acfd42ea715e132abddbc0877a5d0ba9e071c5639d1cb956"
"7d49c8019ef86549321c577193f0cd6ecba852013730ccda7f9d3b25dd6b10ffca6628835"
"c52f4c4775d3cc295d814b542abe370abac97a2b71c5949736d7c007442b956deac50bdcf"
"f423e4b2304e7153fffc61d5a15361ada3444e67075f09f15a4eefaf1d6710d9e4e44b6ad"
"bf175caeb3446c64ead56333c8c0df6a487b549ec2b9bf5d733edbc062ce874986caf63756";
bool dbm_example_init(void){
std::wstring szLogDir =L"C:\\temp";
DWORD dwBackupFiles=7;
size_t ulMaxFileSize= (1024 * 1024);
int nRetCode =
SFLOG_INITW(szAppName,szLogDir.c_str(), dwBackupFiles, ulMaxFileSize,&uLOGToken);
std::wcout << L" SUCCESS - Logging system is initialized" << std::endl;
nRetCode =
SFLUC_INIT( szProdKey, szLicenseKey,szActivationCode, &uLUCToken);
std::wcout << L" SUCCESS - License module is initialized" << std::endl;
LCID dwLocale = 1033;
std::wstring szFileName(TEXT("spiderxl.db"));
nRetCode =
SFDB_Init(szFileName.c_str(), NULL , dwLocale, &uDBMToken);
std::wcout << L" SUCCESS - Date and Calendar module is initialized" << std::endl;
return true;
}
uLUCToken = unsigned(-1)
}
uLOGToken = unsigned(-1);
}
return false;
}
void dbm_example_shutdown(void){
if(uDBMToken != unsigned(-1)){
uDBMToken = unsigned(-1);
}
if( uLUCToken != unsigned(-1)){
uLUCToken != unsigned(-1);
}
if( uLOGToken != unsigned(-1)){
uLOGToken= unsigned(-1);
}
}
int __stdcall SFDB_Init(LPCWSTR szBaseFileName, LPCWSTR szResDir, DWORD dwLocale, unsigned int *pClientToken)
Initialize/Configure the date/calendar analytics module (SFDBM)
Definition SFDBM.cpp:66
int __stdcall SFDB_Shutdown(unsigned int uClientToken)
Shutdown the session (e.g. closes files, terminate database connection, etc.)
Definition SFDBM.cpp:217
int __stdcall SFLOG_INITW(LPCWSTR szAppName, LPCWSTR szLogDir, DWORD dwBackupFiles, size_t ulMaxFileSize, unsigned int *pClientToken)
int __stdcall SFLOG_SHUTDOWN(unsigned int uClientToken)
int __stdcall SFLUC_SHUTDOWN(unsigned int uLUCToken)
int __stdcall SFLUC_INIT(LPCWSTR argPRODKey, LPCWSTR argLicenseKey, LPCWSTR argActivationCode, unsigned *pClientToken)