You can use e.g. Microsoft Visual C++ 6.0 as compiler.
Proceed as follows to use the EPLAN 21 API:
Integrate the "eplapi32.lib" library contained in the "Api 3.20.2\lib" directory into the project.
Specify the path for the header files. To do so, add the "include" directory "Api 3.20.2\include" to the project settings.
Insert the include command #include "EplanApi.h"
into the source-code files.
After EPLAN 21 has been initialized and the first session has been created, call up the licensing command "EPLAN.EPLAN21.LICENSE" (see example).
//Initialize Eplan eplInitialize(); //Create session: EplHandle hSession; hSession = eplCreateSession(); if (hSession != EPL_ERROR) { //Create licensing command EplHandle hcmdLicense = eplCreateCommand(hSession, L"EPLAN.EPLAN21.LICENSE"); if (hcmdLicense != PL_ERROR) { //Set licensing key eplSetParam(hSession, hcmdLicense, EPL_PARAM_LICENSE_USERNAME, "IHR_LIZENZNAME", 0); eplSetParam(hSession, hcmdLicense, EPL_PARAM_LICENSE_USERNUMBER, "1234567890ABC", 0); //Execute licensing command if (eplExecuteCommand(hSession, hcmdLicense) != EPL_ERROR) { //Licensing successful ... } else { //Error treatment ... } } else { //Error treatment ... } } else { //Error treatment ... } eplDeinitialize(); |