Symptoms
Although OLE controls are used with certain control containers (such asMicrosoft Visual Basic version 4.0), the Serialize function for the control-derived class is not called. These containers allow the control to storeits persistent information either by using the property sets or by usingthe IPersistPropertyBag interface. Both these methods callCOleControl::DoPropExchange directly without calling the control’sSerialize function.
The resolution section of this article discusses a technique that you canuse in the DoPropExchange method to store CObject-derived objects.
Resolution
COleControl::Serialize is called by the framework when an OLE controlcontainer uses one of the following persistent storage interfaces forloading and saving the control: IPersistStorage, IPersistStreamInit, orIPersistMemory.
If a control container uses any other method to store the control’spersistent information, then Serialize for the control-derived class willnot be called. Microsoft Visual Basic, for example, uses eitherIPersistPropertyBag or property sets to store the persistent informationfor an OLE control; therefore, the Serialize function for a control is notcalled when Visual Basic is used as the control container.