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 |
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 |
• | 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
#include "CLicProtectorEasyGo410.h"
CLicProtectorEasyGo410 licProtector; // Licence Protector object
// Create the automation object BOOL bRes = licProtector.CreateDispatch("LicProtector.LicProtectorDLL410");
|
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 |
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