Step #1: Create test application
At the first step we’ll create a test application. It will be a simple application, withour user interface and functionality it will just call licensing module and get result.
#include <windows.h>
#include <stdio.h>
bool is_registered(const char *serial)
{
return serial && serial[0] == 'X';
}
int main(int argc, char **argv)
{
char *serial = "Xserialnumber"; // define serial number in the code
if (!is_registered(serial))
{
printf("please register!\n");
return 0;
}
printf("We are registered.\n");
return 0;
}
Our application checks serial number itself using is_registered() function. This function says that number is correct if the first letter or serial number is ‘X’. If number is correct, our application prints “We are registered”, otherwise it asks for registration.
At the second step we’ll ask the licensing module to check our serial number.