PGSLIC.lib  3.0
HelloWorld.cpp
/*
* HelloWorld.cpp
*
* The simplest licensed application example. Just checks for a valid license
* and prints its message if the license checks out ok.
*/
#include <iostream>
#include <fstream>
#include "../../include/example_utils.h"
#include "../../include/pgslic.h"
using std::cout;
using std::cerr;
using std::endl;
using nuvovis::readTextFileUntilSpace;
namespace
{
const char* PWD = "---Replace with your Developer Key---";
const char* LICS_DIR = "."; // Store license file in current working directory.
}
int main()
{
const char CONFIG_FILENAME[] = "HelloWorld.ini"; // The current working directory is where the configuration file is stored.
const char APP_NAME[] = "Hello World";
if (checkLicense(LICS_DIR, PWD, readTextFileUntilSpace(CONFIG_FILENAME).c_str(), APP_NAME) != nuvovis::LICENSE_OK)
{
cerr << "*** Error: License check failed: " << getLastError() << endl;
return 1;
}
cout << "Hello World!" << endl;
return 0;
}
@ LICENSE_OK
Definition: pgslic.h:96
PGSLIC_API const char * getLastError()
PGSLIC_API LicenseStatus checkLicense(const char *licPath, const char *pwd, const char *key, const char *appName, const char *appInfo="", const char *cxnOpts="")