Creating a Custom Action DLL

Open the LVCA.h file in the "\Platform\include" directory. After the enumerations and the #defines there is a typedef.

typedef LVCA_API BOOL (WINAPI *LVCUSTOMCALLBACK)(LONG, HANDLE);

This is the template for building the user defined Custom Actions. Essentially, this is a callback function. WINAPI is defined as __stdcall, which makes the function Pascal compliant. The callback takes two parameters: a LONG and a HANDLE. The LONG is a message to the callback to know what state is of the current call; the HANDLE is a value that the user defined Custom Action passes back to the LVCA functions to retrieve additional information about the call.

There are two predefined named functions which are expected in the user defined Custom Action DLL. The LV_Call_Start and the LV_Call_End. These functions are called and the start and end of a call respectively.

The Events

CAMSG_POLL

This is a message that is called to verify the validity of a callback function. The only action that should be performed by the Custom Action on this event is to return TRUE;

CAMSG_ENTERMODULE

Each time a module is entered, this event will fire.

CAMSG_REC_BEFORE_CONFIRM

This event is fired right after the audio has been decoded. The Call Handler has performed no evaluation of the concepts at that time.

CAMSG_REC_AFTER_CONFIRM

After the Call Handler has picked and confirmed (if necessary) a Handler has performed no evaluation of the concepts at that time.

CAMSG_TIMEOUT

When a Custom Action call does not return before the time out, the previous event thread is terminated and this event is fired.

Building A Custom Action DLL Using Microsoft Visual Studio 6.0

  1. Open the Microsoft Visual Studio application.
  2. Select the projects tab if it is not already selected.
  3. From the projects select the "Win32 Dynamic-Link Library" entry.
  4. Type a valid name in the "Project name" edit box.
  5. Click on OK.
  6. On the next tab, select "A DLL that exports some symbols".
  7. Click Finish.
  8. Click OK on the "New Project Information" dialog.

Modifying the Setting of the Custom Action C++ Project

When the Platform was installed several environment variables were installed. LVBIN, LVINCLUDE and LVLIB. These variables will be used in setting up the C++ project.

  1. Select the menu Project|Settings.
  2. Select the "C/C++" tab.
  3. Select the "Preprocessor" on the "Category" drop down list.
  4. Under "Additional include directories:" type $(LVINCLUDE).
  5. Select the "Link" tab
  6. Select "General" on the Category drop down list.
  7. Under "Object/Library modules:" type LVCA.LIB at the end of the list of libraries.
  8. Staying on the link tab, select "Input" from the "Category" drop down list.
  9. Under "Additional library path:" type $(LVLIB) at the end of any text present already.
  10. Click OK.
© 2012 LumenVox LLC. All rights reserved.