ReconstructMe SDK  2.6.43-0
Real-time 3D reconstruction engine
example_reconstructmesdk_license.cpp

Content

This short example shows how to license ReconstructMe SDK for commerical usage.

Boost is only used to generate examples and is not necessary for working with this SDK.

#include <boost/test/unit_test.hpp>
#include <stdio.h>
#include <iostream>
#include <fstream>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(license) {
// Create a new context
// Create a license object
reme_error_t e = reme_license_authenticate(c, l, "license.txt.sgn");
if (e == REME_ERROR_SUCCESS) {
puts("Now running in commercial mode");
} else {
puts("Failed to authenticate.");
}
std::ifstream ifs("license.txt.sgn");
std::string loaded_license((std::istreambuf_iterator<char>(ifs)),
std::istreambuf_iterator<char>());
e = reme_license_authenticate(c, l, loaded_license.c_str());
if (e == REME_ERROR_SUCCESS) {
puts("Now running in commercial mode");
} else {
puts("Failed to authenticate.");
}
// Specify your HASP specific values.
std::string hasp_dll("hasp_windows_<vendor_id>.dll");
std::string hasp_vendor_code(".....");
reme_license_add_hardware_collector_hasp(c, l, hasp_vendor_code.c_str(), (int)hasp_vendor_code.size(), hasp_dll.c_str(), (int)hasp_dll.size());
e = reme_license_authenticate(c, l, "dongle_protected_license.txt.sgn");
if (e == REME_ERROR_SUCCESS) {
puts("Now running in commercial mode");
} else {
puts("Failed to authenticate.");
}
}
BOOST_AUTO_TEST_SUITE_END()