Using macros in your programming language

<< Click to Display Table of Contents >>

Navigation:  WinLicense > SecureEngine® Macros >

Using macros in your programming language

The current version of SecureEngine supports macros for native applications (developed with C/C++, Delphi, Visual Basic, etc.). Please note that these macros are not available for .NET languages or Visual Basic compiled in PCode mode.

 

To apply a macro to a specific block of code, you have to mark the beginning of the block with the "MacroName_START" marker and the end of the block using the "MacroName_END" marker.

 

 

Restrictions

 

A few conditions need to be satisfied in order to successfully insert SecureEngine® macros into your application. If any of these conditions are not fulfilled, WinLicense will show an error message when opening the file to be protected. The conditions are the following:

 

Macros cannot be nested, that is, a macro cannot be inserted inside another macro. The following is an example of nesting macros:

 

void MyFunction(void)

{

  VM_START

 

     // your code

 

    VM_START     <--- nested!!!

 

         // your code

 

    VM_END

 

     // your code

 

  VM_END

}

 

Each macro needs to have each corresponding "MacroName_END" delimiter.

 

The code inside the macro must be at least 5 bytes in size.

 

 

Usage for specific programming languages

Click to expand/collapseSpecific information for Delphi developers
Click to expand/collapseSpecific information for C/C++ developers
Click to expand/collapseSpecific information for Visual Basic developers