Overview of ATEasy DLL (Dynamic Link Library)

 

Starting from ATEasy version 7.0, ATEasy provides a way to create DLLs.

ATEasy DLL is similar to other DLLs which developed with tools such as Microsoft Visual Studio. As other DLLs, ATEasy DLL may be inserted to any ATEasy modules (driver, system, program) and called by any ATEasy applications or other applications written in different programming languages.

Here are the steps required to create a DLL:

  1. Create a project with a target type DLL with a system and optionally, additional modules (driver or programs). Use the Library Wizard to create a new DLL project with a System file and optional driver(s). The Application wizard will set the project property Target Type to Dynamic Link Library (DLL) which will cause ATEasy to create a DLL instead of an EXE.  See Library Wizard.
     

  2. Create procedures or I/O tables and set their properties to Export from the procedure or I/O table property page. These procedures will be exported by DLL and can be called externally by other ATEasy modules or by other language such as Visual Basic / C++ etc. see Procedures Overview for how to create procedure and Procedure Properties to learn how to set the Export attribute.
     

  3. Optionally fill the OnInit/OnInitSystem/OnEndSystem/OnEnd events in the system or any driver modules you have created. The OnInit events will be called just before DLL first function is called. The OnEnd events will be called when DLL is unloaded by the application. See ATEasy DLL Events.
     

  4. Debug your DLL by calling procedures using DoIt or by running it. DLL procedures can be called within the DLL project. Typically you will create a procedure that will contain calls to DLL exported functions for testing. You can trace and step into the exported functions, place breakpoints, and use trace and print statements (while the DLL project is the Active Project).
     

  5. Build the Project. This will create the DLL file.
     

  6. Use the DLL from other ATEasy modules or by other development language tools. From ATEasy you insert the ATEasy DLL to an ATEasy module via the insert Library DLL page. And this dialog has an option to import the exported function and the data types used by these exported functions automatically without requiring you to define the functions manually.
     

  7. Debug the DLL with your other application. Call the exported functions, check the input and output parameters and make sure your DLL is working. ATEasy debugger will not allow you to trace/step inside the DLL code. However you can use print or trace messages, MsgBox and other ways to debug your code. You can set the DLL Log Variable to the application Log (for example to the application test executive test log) so that a print from the DLL will output to the application test log.
     

  8. Distribute your DLL. You must include the ATEasy run time file (similarly the way ATEasy application are distributed).

ATEasy DLLs have certain benefits over other DLLs; that is, ATEasy DLL contains type information allowing importing functions and types without declaring them manually (using the Import ATEasy procedure command).  Also when ATEasy calls the DLL procedures it passes the argument in native mode thus reducing the time needed to convert the arguments to ATEasy types.