Licence Protector

C++

Hide Navigation Pane

C++

Previous topic Next topic No directory for this topic  

C++

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for the print function Mail us feedback on this topic!  

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

 

First download the c++ sample you need from the FAQ area on our website (there is a sample for C++ with MFC and without MFC)

 

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\3.1\files for distribution\signed-uncompressed

Press Button ">>" to generate the class from the provided interface

Keep the Name (e.g. CLicProtectorEasyGo313.h) and press "Finish"

Now you have a file CLicProtectorEasyGo313.h in your project.
 

In file EasyGoDemoView.cpp sample modify the line using the latest version number

    #include "CLicProtectorEasyGo313.h"

 

In function CEasyGoDemoView::ProtectMe() adapt the lines

 CLicProtectorEasyGo313 licProtector;   // Licence Protector object

 

 // Create the automation object

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

         

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.LicProtectorDLL313
 

All neccessary include files are generated automatically.

To create an instance of the Licence Protector object the following lines are needed:

 

 CoInitialize(NULL);

 ILicProtectorEasyGo313* lp = NULL;

           CoCreateInstance(__uuidof(LicProtectorEasyGo313), NULL, CLSCTX_INPROC_SERVER, __uuidof(ILicProtectorEasyGo313), (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 LicProtector313dll with "File" - "View TypeLib...". The DLL can be found in the folder ....\Licence Protector\3.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\LicProtector313.idl /out C:\MIDLTest /header LicProtector313.h
 

 

Use the file CLicProtectorEasyGo313.h in your project.

In file EasyGoDemoView.cpp sample modify the line using the latest version number

    #include "CLicProtectorEasyGo313.h"

In function CEasyGoDemoView::ProtectMe() adapt the lines

 CLicProtectorEasyGo313 licProtector;   // Licence Protector object

 

 // Create the automation object

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

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.

 

 

 

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