Microsoft KB Archive/257289

= INFO: MSMQ Triggers Service Uses Late Binding (IDispatch) to COM Objects =

Article ID: 257289

Article Last Modified on 10/26/2007

-

APPLIES TO


 * Microsoft Message Queue Server 1.0
 * Microsoft Message Queuing 2.0

-



This article was previously published under Q257289



SUMMARY
The Message Queuing (MSMQ) Triggers service provides a mechanism to call a method of a COM object from a trigger. For this mechanism to work properly, the COM object must implement the COM IDispatch interface.

When you try to invoke a COM component that is written in C++ and you are not using the IDispatch interface, the Message Queuing Triggers service may not be successful and you may receive the following error message:

Error: 0x80004002 No Such Interface



MORE INFORMATION
To configure an action for a trigger, you need to specify the programmatic identifier (ProgID) of the COM object, and the name of the method by using the Triggers Microsoft Management Console (MMC) Snap-In.

In order to call COM objects at run time based on name, all operations on the object must be done with late (run-time) binding through the IDispatch interface. If the called object does not implement an IDispatch or dual interface, the call fails when the trigger is activated.

COM objects that are created by using Microsoft Visual Basic automatically implement a dual interface. Objects created in other languages may require additional implementation.

