Step 1: Import Tethys Macro SDK ActiveX DLL in your project
The following statements should be written, where you specify to include other header files.
#import "WKSPSDK.dll"
using namespace WKSPSDK;
Note: WKSPSDK.dll should be either in the System32 directory or application path.
Step 2: Create an Instance of the Tethys Macro SDK ActiveX DLL
The following variable should be declared globally. And the Initialization should be done in some public class, such that it is accessible to all other functions.
HRESULT hresult;
CLSID clsid;
_ClsWKSPSDK *SDKObject
CoInitialize(NULL); //initialize COM library
hresult=CLSIDFromProgID(OLESTR("WKSPSDK.ClsWKSPSDK"), &clsid);
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_ClsWKSPSDK),(LPVOID *) &SDKObject);
Step 3: Call the functions of Tethys Macro SDK ActiveX DLL
StartRecording
SDKObject->StartRecording();
StopRecording
SDKObject->StopRecording();
SaveRecording
_bstr_t bstrFileName;
_bstr_t bstrPassword("MyPassword");
bstrFileName= "C:\\MyWKSP.wksp";
SDKObject-> SaveRecording(bstrFileName, bstrPassword, 1,0);
RunMacro
_bstr_t bstrFileName;
bstrFileName= "C:\\MyWKSP.wksp";
_bstr_t bstrPassword("MyPassword");
_bstr_t bstrLogError;
bstrLogError= "C:\\ErrorLog.txt";
SDKObject ->RunMacro(bstrFileName,bstrPassword,1,bstrLogError);
Step 4: Test the functions.
Compile and Execute your C++ Program and test the SDK functions.