This is an example program how to initialzie the Calendar and Date Analytics API. More details about this example.
#include <windows.h>
#include <iostream>
#include <string>
#include "SFLOG.h"
#include "SFLUC.h"
#include "SFSDK.h"
int main(){
std::wstring szAppName = L"testapp";
std::wstring szLogDir =L"C:\\temp";
DWORD dwBackupFiles=7;
size_t ulMaxFileSize= (1024 * 1024);
unsigned int uLOGToken=0;
int nRetCode =
SFLOG_INITW(szAppName.c_str(),szLogDir.c_str(), dwBackupFiles, ulMaxFileSize,&uLOGToken);
std::cout << " SUCCESS - Logging system is initialized .." << std::endl;
unsigned uLUCToken=unsigned(-1);
std::wstring szProdKey(L"31223-200-169");
std::wstring szLicenseKey(L"79F7-C8-A9-01-7777");
std::wstring szActivationCode(L"2c07d642fe1ef089e5517d35e15f186814e17fb80b25cd950e77ade2e63c82c65d94ca639a77475d11981fd0a06e3ece730ef09c53c1f2da6d89d9a1d453d5e3678e50786a42101f194ffd543c2b72b55576fa52796acfd42ea715e132abddbc0877a5d0ba9e071c5639d1cb9567d49c8019ef86549321c577193f0cd6ecba852013730ccda7f9d3b25dd6b10ffca6628835c52f4c4775d3cc295d814b542abe370abac97a2b71c5949736d7c007442b956deac50bdcff423e4b2304e7153fffc61d5a15361ada3444e67075f09f15a4eefaf1d6710d9e4e44b6adbf175caeb3446c64ead56333c8c0df6a487b549ec2b9bf5d733edbc062ce874986caf63756");
nRetCode =
SFLUC_INIT( szProdKey.c_str(), szLicenseKey.c_str(),szActivationCode.c_str(), &uLUCToken);
std::wcout << L" SUCCESS - License system is initialized" << std::endl;
unsigned int m_uSDKToken = unsigned(-1);
nRetCode =
NDK_Init(szAppName.c_str(), NULL, 0L , &m_uSDKToken);
std::wcout << L" SUCCESS - Analytics SDK system is initialized" << std::endl;
std::wcout << L" SUCCESS - License key is activated, and system is in pro mode" << std::endl;
double airline_data[156]={
112,118,132,129,121,135,148,148,136,119,104,118,
115,126,141,135,125,149,170,170,158,133,114,140,
145,150,178,163,172,178,199,199,184,162,146,166,
171,180,193,181,183,218,230,242,209,191,172,194,
196,196,236,235,229,243,264,272,237,211,180,201,
204,188,235,227,234,264,302,293,259,229,203,229,
242,233,267,269,270,315,364,347,312,274,237,278,
284,277,317,313,318,374,413,405,355,306,271,306,
315,301,356,348,355,422,465,467,404,347,305,336,
340,318,362,348,363,435,491,505,404,359,310,337,
360,342,406,396,420,472,548,559,463,407,362,405,
417,391,419,461,472,535,622,606,508,461,390,432,
444,416,472,499,497,579,667,657,557,492,425,481};
double alpha=0.3;
double retVal=0.0;
nRetCode =
NDK_SESMTH(airline_data, 156, TRUE, &alpha, 1, TRUE, NULL, 0, &retVal);
std::wcout << L" SUCCESS - SESMTH returns: " << retVal << std::endl;
}
}
}
}
std::cout << " Shutting down the Logging system ..." << std::endl;
}
return 0;
}
int __stdcall NDK_Init(LPCWSTR szBaseName, LPCWSTR szDataPath, long consoleAppTimeout, unsigned int *pClientToken)
int __stdcall NDK_Shutdown(BOOL cleanup, unsigned int uClientToken)
int __stdcall NDK_SESMTH(double *pData, size_t nSize, BOOL bAscending, double *alpha, int nHorizon, BOOL bOptimize, double *internals, size_t nInternalsSize, double *retVal)
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)
int __stdcall SFLUC_CHECK_LICENSE(void)