Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This method registers the caller as a subscriber to a specified publisher on a specified device.
HRESULT Subscribe(GUID PlatformID,GUID DeviceID,GUID PublisherID,ISubscriber* pSubscriber,IPublisher** ppPublisher,GUID* pCookieID);
Parameters
- PlatformID
[in] GUID of the platform. - DeviceID
[in] GUID of the device associated with the specified platform. - PublisherID
[in] GUID of the publisher to connect to. - pSubscriber
[in] Pointer to the ISubscriber interface. The pointer's ISubscriber::Write method is called by the subscriber service when data is published by the specified publisher. - ppPublisher
[out] Pointer to a pointer to the IPublisher interface. - pCookieID
[out] Pointer to a cookie that uniquely identifies the caller. The caller must pass this cookie when calling the IPublishSubscribeMgr::Unsubscribe method.
Return Values
The following table shows the return values for this method.
Return value | Description |
---|---|
S_OK | The call was successfully completed. |
E_INVALIDARG | The PlatformID, DeviceID, or PublisherID parameter is GUID_NULL. |
E_POINTER | The pSubscriber, ppPublisher, or pCookieID parameter is NULL. |
E_FAIL | Unable to complete the call. |
Remarks
A client may subscribe to one or more publishers on one or more devices.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: CEPubSub.h (for development workstation), CEPubSubPS.h (for target device), CePubSub.idl.
Link Library: Rts.lib (for development workstation), PSPubSubCE.lib (for target device).
See Also
IPublisher | ISubscriber | IPublishSubscribeMgr::Unsubscribe | ISubscriber::Write
Send Feedback on this topic to the authors