Connection State API Corrections
[This is now documented here: https://msdn2.microsoft.com/en-us/library/bb905128.aspx]
I've been working with Dmitry Streblechenko on getting a sample using the Connection State API. We've uncovered a number of doc bugs. All of them have been reported back to the content folks and should be corrected in the next refresh, but in the interest of unblocking folks who want to use this API, here they are:
On the Constants page:
Cut these definitions:
MAPIOFFLINE_CALLBACK_TYPE_NOTIFY MAPIOFFLINE_NOTIFY_TYPE_STATECHANGE MAPIOFFLINE_NOTIFY_TYPE_STATECHANGE_DONE
Under Data Types
The MAPIOFFLINE_CALLBACK_TYPE enum should read
typedef enum { MAPIOFFLINE_CALLBACK_TYPE_NOTIFY = 0 } MAPIOFFLINE_CALLBACK_TYPE;
Add the following enum
typedef enum { MAPIOFFLINE_NOTIFY_TYPE_STATECHANGE = 2, MAPIOFFLINE_NOTIFY_TYPE_STATECHANGE_DONE = 3 } MAPIOFFLINE_NOTIFY_TYPE;
On the MAPIOFFLINE_NOTIFY page, the NotifyType section should read
Type of notification. Note that only notification on change of connection state is supported; the only supported values are: MAPIOFFLINE_NOTIFY_TYPE_STATECHANGE MAPIOFFLINE_NOTIFY_TYPE_STATECHANGE_DONE
On the HrOpenOfflineObj page
The export for GetProcAddress is HrOpenOfflineObj@20
The following signature for the function pointer should be listed
typedef HRESULT (STDMETHODCALLTYPE HROPENOFFLINEOBJ)( ULONG ulFlags, LPCWSTR pwszProfileName, const GUID* pGUID, const GUID* pInstance, IMAPIOfflineMgr** ppOffline );
Under Interfaces
-
Should be documented as inheriting from IUnknown
This is the correct v-table
Placeholder member This member is a placeholder and is not supported. GetCapabilities Gets the conditions for which callbacks are supported by a connection state object. Placeholder member This member is a placeholder and is not supported. Placeholder member This member is a placeholder and is not supported.
IMAPIOffline::GetCapabilities, the pulCapabilities section should begin
A bitmask of the following capabilities flags
-
- Should be documented as inheriting from IMAPIOffline
-
Corrected signature:
void STDMETHODCALLTYPE Notify( const MAPIOFFLINE_NOTIFY *pNotifyInfo );
Comments
- Anonymous
December 21, 2004
Does similar functionality exists in Exchange MAPI? Currently there is a bug (or a feature?) in Exchange MAPI - when Exchange server is restarted all notifications on user stores/folders will be no longer be triggered and there is no way to tell that Exchange server was restarted, so you can re Advise sinks. No notification are sent on Exchange server restart :( - Anonymous
December 22, 2004
I'm not sure the Connection State API would be that useful in that scenario either. Dmitry's got his implementation in Outlook Spy working. Pehaps he could comment on what he sees. - Anonymous
December 22, 2004
I got my add-in implementation up so I could test this. As documented, this API only gives notification for switching between online and offline mode. It does not provide notification for switching to disconnected mode. So this API does not cover the scenario you mention. - Anonymous
December 22, 2004
No, I don't think you will get a notification, at least I don't get it when I unplug the cable and Outlook goes to the disconnected state.
The notification gets triggered only if you explciitly go offline using File | Work Offline.