IRTCClientPresence::EnablePresence
The EnablePresence method enables the presence functionality for both outgoing and incoming subscriptions. Presence is not enabled until this method is called.
HRESULT EnablePresence(VARIANT_BOOLfUseStorage,
VARIANTvarStorage);
Parameters
- fUseStorage
[in] Specifies whether the lists will load from storage and automatically commit any changes back to storage. A value of false will enable presence, but not use storage. Presence will be enabled with empty Buddy and Watcher lists. - varStorage
[in] Specifies the persistent storage for the list of buddies and the allowed and blocked watchers. This variant can contain a file name (BSTR), a DOMDocument object, or any object that supports IStream, ISequentialStream, or IPersistStream.
Return Values
RTC methods may return an RTC_E_ constant.
Value | Meaning |
---|---|
RTC_E_CLIENT_NOT_INITIALIZED | The client is not initialized. |
S_FALSE | Presence was enabled but failed to load from storage. |
Remarks
This method should be called only after a PC-PC profile has been enabled for presence using the EnableProfile method. This default profile will be used when creating buddies from the presence store (fUseStorage is set to TRUE).
EnablePresence must be called before any other presence methods are called. Subsequent calls to EnablePresence will close the existing presence store (or the list of buddies will be lost if there was no storage) and the new specified store will be opened.
The Buddies and Watchers have a persistence property that is set when they are added to the presence list. This property determines whether they will be part of the persistent storage (varStorage).
Note The RTC Client API does not set ACLs on the presence storage file. An application may want to consider setting an ACL on this file for better security.
The storage used in this method is subject to change and further revisions.
Requirements
Client: Requires Windows XP.
Server: Requires Windows Server 2003.
Redistributable: Requires Rtcdll.dll on Windows 2000, and Windows Me/98.
Header: Declared in Rtccore.h.
Library: Included as a resource in Rtcdll.dll.
GUID: IID_IRTCClientPresence is defined as 11c3cbcc-0744-42d1-968a-51aa1bb274c6.