C++ needs header files. Depending on the compiler you use they can be automatically created.

 

First download the c++ sample code

 

Visual Studio 2010 (and newer) C++ with MFC
Visual Studio 2010 (and newer) C++ without MFC
Visual Studio 2008 C++ with MFC
Visual Studio 2008 C++ without MFC
C++ for Version 6.0 with MFC (can also be imported in Visual Studio 2003) for EasyGo
C++ for Version 6.0 without MFC (can also be imported in Visual Studio 2003) for EasyGo

 

 

Using C++ with MFC

 

Find below how to add a DLL to Visual Studio C++

 

In Visual Studio right click on the project and Add a new class
Choose type "MFC class from TypeLib"
In the Class Wizard set "Add class from file" and select in "Location" the DLL you have just registered. The DLL can be found in the folder ....\Licence Protector\4.1\files for distribution\DLL
Press Button ">>" to generate the class from the provided interface
Keep the Name (e.g. CLicProtectorEasyGo410.h) and press "Finish"
Now you have a file CLicProtectorEasyGo410.h in your project.
 
In file EasyGoDemoView.cpp sample modify the line using the latest version number

    #include "CLicProtectorEasyGo410.h"

 

In function CEasyGoDemoView::ProtectMe() adapt the lines

 CLicProtectorEasyGo410 licProtector;   // Licence Protector object

 

 // Create the automation object

 BOOL bRes = licProtector.CreateDispatch("LicProtector.LicProtectorDLL410");

         

Rebuild the project

 

 

Using C++ without MFC

 

The DLL can be imported in a c++ project by adding the following line at the top of the source code:

#import "progid:LicProtector.LicProtectorDLL410
 

All neccessary include files are generated automatically.
To create an instance of the Licence Protector object the following lines are needed:

 

 CoInitialize(NULL);

 ILicProtectorEasyGo410* lp = NULL;

           CoCreateInstance(__uuidof(LicProtectorEasyGo410), NULL, CLSCTX_INPROC_SERVER, __uuidof(ILicProtectorEasyGo410), (void**)&lp);

 

Only if the #import command is not available with your C compiler use the following method to build a header file

 

       Create header file

Use the "OLEViewer Version 2.1 or later". It comes with Visual Studio, Win32SDK or can be downloaded from the Microsoft Homepage
http://www.microsoft.com/downloads/details.aspx?FamilyID=5233b70d-d9b2-4cb5-aeb6-45664be858b6&DisplayLang=en
Open the "oleview.exe"
Open the LicProtector410dll with "File" - "View TypeLib...". The DLL can be found in the folder ....\Licence Protector\4.1\files for distribution\signed-compressed
Save the generated text into a ".idl" file
Open the idl-file with a text-editor and copy the typedef sections from the end to the beginning of the library section. Save the idl-file.
Search for the "midl.exe" on your system  (it comes with Visual Studio or Win32SDK)
Execute the "midl.exe" with command line parameters (IDL file, header file)
example: midl.exe C:\MIDLTest\LicProtector410.idl /out C:\MIDLTest /header LicProtector410.h
 

 

Use the file CLicProtectorEasyGo410.h in your project.
In file EasyGoDemoView.cpp sample modify the line using the latest version number

    #include "CLicProtectorEasyGo410.h"

In function CEasyGoDemoView::ProtectMe() adapt the lines

 CLicProtectorEasyGo410 licProtector;   // Licence Protector object

 

 // Create the automation object

 BOOL bRes = licProtector.CreateDispatch("LicProtector.LicProtectorDLL410");          

Rebuild the project

 

 
Note: if the "midl.exe" tells you that there is a file missing (for example "OAIdl.Idl"), search your system for it and copy it into the directory of the "midl.exe".

 

Additional information

 

The latest information about the ProgID, ClASSID, IID, LIBID can be found here.

 

As Licence Protector is a COM server DLL it is used the same way you would integrate a Word automation. Just google for - Word Automation DLL C++ to find guides for different compilers.

 

For Visual Studio C++ 2007 and newer you need Licence Protector version 4.1
Compiling with .NET 4 will result in an error.  Compile using the COM exe

 

Code Protection with All-In-One Protector

To protect the code against de-compilation or reverse engineering, you can combine Licence Protector with All-In-One Protector for a special bundle price.

 

See chapter: Code Protection / Decompile Protection