Please enable JavaScript to view this site.

ESL Documentation

Navigation: » No topics above this level «

Q11 What calling convention should I be using for dlls?

Scroll Prev Top Next More

The entry points for DLL's is dependant on the type of call being made and the version of ESL being used. Prior to version 14.20, all entry points must be APIENTRY. For example a function entry points into the DLL should look like:

ret_type APIENTRY Function_Name(type argument,[type argument, ...])

With version 14.20, to allow continued support for DLL's written using COBOL, the calling convention for external subroutines, has been changed to the 'C' standard (i.e. __cdecl). For convenience, macros have be defined in ESLLib.h for both external subroutines and functions. To insulate your code from any future changes, we recommend you use, ESLSUBAPI for all external subroutines, for example;

LONG ESLSUBAPI Subroutine_Name(type argument,[type argument, ...])

And ESLFNCAPI for all functions, for example;

ret_type ESLFNCAPI Function_Name(type argument,[type argument, ...])

All other entry points in a DLL, for example the initialization routine for a stimulus library must continue to use APIENTRY, defined in WINDOWS.h; for example;

LONG APIENTRY InitializeStimulus (HWND hWnd)