Share via


IUPnPService::AddCallback (Windows Embedded CE 6.0)

1/6/2010

This method registers an application's callback with UPnP.

Syntax

HRESULT AddCallback(
  IUnknown* pUnkCallback
);

Parameters

  • pUnkCallback
    [in] Specifies the reference to the interface that contains the callback to register.

Return Value

  • S_OK
    This method was successful.

Otherwise, the method returns one of the COM error codes defined in WinError.h.

Remarks

When the first callback is registered for a given service, the control point is subscribing to an event from the device. The device will send the first event with the current values of all of the variables.

Do not call this method from within a callback.

If more than one callback is registered, UPnP invokes the callbacks sequentially.

The object referred to by pUnkCallback must either support the IUPnPServiceCallback interface, or the IDispatch interface. The IUPnPService::AddCallback method first queries pUnkCallback for the IUPnPServiceCallback interface. If this interface is not supported, the IUPnPService::AddCallback method then queries pUnkCallback for the IDispatch interface. If the IDispatch interface is not supported, both checks have failed and the IUPnPService::AddCallback method returns E_FAIL.

If only IDispatch is supported, the Service object invokes the callback by calling IDispatch::Invoke, which indicates the default method. This default IDispatch method is passed the same parameters as the IUPnPServiceCallback method, but the first parameter passed is a string that indicates the reason the callback is invoked. Valid values are VARIABLE_UPDATE and SERVICE_INSTANCE_DIED.

Requirements

Header upnp.h
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

IUPnPService
IUPnPServiceCallback