HrOpenOfflineObj

Applies to: Office 2010 | Outlook 2010 | Visual Studio

In this article
Quick Info
Parameters
Return Values
Remarks

Opens an offline object based on a given profile.

Quick Info

Exported by:

msmapi32.dll

Called by:

Client

Implemented by:

Outlook

typedef HRESULT (STDMETHODCALLTYPE HROPENOFFLINEOBJ)( 
      ULONG ulReserved, 
      LPCWSTR pwszProfileNameIn, 
      const GUID* pGUID, 
      const GUID* pReserved, 
      IMAPIOfflineMgr** ppOfflineObj); 

Parameters

  • ulReserved
    [in] This parameter is not used. It must be 0.

  • pwszProfileNameIn
    [in] The name of the profile that the offline object is for. It must be expressed in Unicode.

  • pGUID
    [in] Pointer to a GUID which can be used to uniquely identify this object from other offline objects. It must be GUID_GlobalState.

  • pReserved
    [in] This parameter is not used. It must be null.

  • ppOfflineObj
    [out] A pointer to the requested offline object. The caller can use this pointer to access the IMAPIOfflineMgr : IMAPIOffline interface to find the callbacks that this object supports and to set up callbacks for it.

Return Values

S_OK

  • The function call is successful.

MAPI_E_NOT_FOUND

  • The function call failed.

Remarks

This is the first call that a client makes when the client wants to be notified of any connection state changes for a given profile. Upon calling HrOpenOfflineObj, the client obtains an offline object that supports IMAPIOfflineMgr. The client can check for the kinds of callbacks supported by the object (by using IMAPIOffline::GetCapabilities), and then set up callbacks for it (by using IMAPIOfflineMgr::Advise).

When using GetProcAddress to look for the address of this function in msmapi32.dll, specify HrOpenOfflineObj@20 as the procedure name.

HrOpenOfflineObj only works for clients that are MAPI providers, COM Add-Ins, and Exchange Client Extensions running inside the Outlook process. Otherwise, HrOpenOfflineObj returns MAPI_E_NOT_FOUND.

See Also

Reference

IMAPIOffline : IUnknown

IMAPIOfflineMgr : IMAPIOffline

Concepts

About the Offline State API

MAPI Constants