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\2.7\files for distribution\signed-compressed |
• | Press Button ">>" to generate the class from the provided interface |
• | Keep the Name (e.g. CLicProtectorEasyGo270.h) and press "Finish" |
• | Now you have a file CLicProtectorEasyGo270.h in your project. |
• | In file EasyGoDemoView.cpp sample modify the line using the latest version number |
#include "CLicProtectorEasyGo270.h"
• | In function CEasyGoDemoView::ProtectMe() adapt the lines |
CLicProtectorEasyGo270 licProtector; // Licence Protector object
// Create the automation object
BOOL bRes = licProtector.CreateDispatch("LicProtectorEasyGo.licProtectorEasyGo270");
• | Rebuild the project |
Using C++ without MFC
• | 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 LicProtector270dll with "File" - "View TypeLib...". The DLL can be found in the folder ....\Licence Protector\2.7\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\LicProtector270.idl /out C:\MIDLTest /header LicProtector270.h |
• | Use the file CLicProtectorEasyGo270.h in your project. |
• | In file EasyGoDemoView.cpp sample modify the line using the latest version number |
#include "CLicProtectorEasyGo270.h"
• | In function CEasyGoDemoView::ProtectMe() adapt the lines |
CLicProtectorEasyGo270 licProtector; // Licence Protector object
// Create the automation object
BOOL bRes = licProtector.CreateDispatch("LicProtectorEasyGo.licProtectorEasyGo270");
• | 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.
Page url: http://www.helpserver.biz/onlinehelp/lp/easygo/2.7/help2000/index.html?using_c.htm