Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How to Implement IDataObject

Windows Mobile 6.5
4/19/2010

Shortcut menu extensions that target Office Mobile applications often process information in clipboard format. The following sample demonstrates code used by such a component.

Bb158557.note(en-us,MSDN.10).gifNote:
Object Identifiers (OIDs) in the pira parameter below, can be used in Pocket Outlook Object Model (POOM) API calls. These API members are declared in the header file Pimstore.h. You can get a handle to a POOM item by calling the IPOutlookApp::GetItemFromOid method. Using this reference as an entry point into the POOM, you can then call POOM APIs (for example, IContact::get_Birthday and ITask::get_StartDate).

For more information on IDataObject, see the Windows Embedded CE topic, IDataObject.

The following code example demonstrates how to implement IDataObject.

Bb158557.note(en-us,MSDN.10).gifNote:
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
#include "appext.h"   // To access ItemRef and ItemRefArray.

FORMATETC fmt;
STGMEDIUM stgmed;
ItemRefArray * pira;
CEOID oid;

fmt.cfFormat = RegisterClipboardFormat(CFNAME_ITEMREFARRAY);
fmt.lindex = -1;
fmt.dwAspect = DVASPECT_CONTENT;
fmt.tymed = TYMED_HGLOBAL;

((IDataObject*)GetSite())->GetData(&fmt, &stgmed);
pira = (ItemRefArray*)stgmed->hGlobal;
oid = (CEOID)pira->rgRefs[0].pRef;

Community Additions

Show:
© 2015 Microsoft