COleServerItem::OnInitFromData

virtual BOOL OnInitFromData( COleDataObject* pDataObject, BOOL bCreation );

Return Value

Nonzero if successful; otherwise 0.

Parameters

pDataObject

Pointer to an OLE data object containing data in various formats for initializing the OLE item.

bCreation

TRUE if the function is called to initialize an OLE item being newly created by a container application. FALSE if the function is called to replace the contents of an already existing OLE item.

Remarks

Called by the framework to initialize an OLE item using the contents of pDataObject. If bCreation is TRUE, this function is called if a container implements Insert New Object based on the current selection. The data selected is used when creating the new OLE item. For example, when selecting a range of cells in a spreadsheet program and then using the Insert New Object to create a chart based on the values in the selected range. The default implementation does nothing. Override this function to choose an acceptable format from those offered by pDataObject and initialize the OLE item based on the data provided. This is an advanced overridable.

For more information, see IOleObject::InitFromData in the OLE 2 Programmer’s Reference, Volume 1.

COleServerItem OverviewClass MembersHierarchy Chart