COM extensions as event handlers
Using COM requires setting up your server and runtime clients.
If you define an event handler as a COM extension, the application calls the COM component you specify as the COM object. The COM component you create must expose the IDispatch interface and a pre-identified function doAction() as part of the interface. The signature of the doAction() function should be as follows:
[IDL Syntax]
doAction ( [in] BSTR sTranID, [in] BSTR sActionCode, [in] BSTR sKeyData, [in]long
DataType, [in] BSTR sData, [in] BSTR ShipNode, [Out] long *Retval);Because the application accesses this function through the IDispatch interface, you can write your COM component either in the Visual Basic or C++ programming language. The function signature that you must expose through Visual Basic is:
Public Function doAction(ByVal bsTranID As String, ByVal boActionCode As String,
ByVal bsKeyData As String, ByVal DataType As Long, ByVal bsData As String, ByVal
ShipNode As String, retVal as Long) As Long The function signature that you must expose through C++ is:
STDMETHODIMP COMActionImpl::doAction(BSTR sTranID, BSTR sActionCode, BSTR sKeyData,
long DataType, BSTR sData, BSTR Node, long *RetVal)COMActionImpl is the class name that implements the doAction() function. While configuring the event handler, you must specify the Program ID of the COM component to be invoked.