CRichEditOleCallback.GetNewStoragemethod
Provides storage for a new object pasted from the clipboard or read in from an Rich Text Format (RTF) stream.
Syntax
FUNCTION GetNewStorage (BYVAL lplpstg AS LPSTORAGE PTR) AS HRESULT
Parameters
| Name | Description | |
|---|---|---|
lplpstg | The address of the IStorage interface created for the new object. |
Return value
Returns S_OK on success. If the method fails, it can return one of the following values.
Description
Provides storage for a new object pasted from the clipboard or read in from an Rich Text Format (RTF) stream.
Remarks
This method must be implemented to allow cut, copy, paste, drag, and drop operations of Component Object Model (COM) objects.
Example
FUNCTION CRichEditOleCallback.GetNewStorage (BYVAL lplpstg AS LPSTORAGE PTR) AS HRESULT DIM hr AS HRESULT DIM pILockBytes AS ILockBytes PTR hr = CreateILockBytesOnHGlobal(NULL, TRUE, @pILockBytes) IF FAILED(hr) THEN RETURN hr hr = StgCreateDocfileOnILockBytes(pILockBytes, _
STGM_SHARE_EXCLUSIVE OR STGM_READWRITE OR STGM_CREATE, 0, lplpstg)
RETURN hr END FUNCTION
Reference
- Defined in AfxNova/CRichEditOleCallback.inc:31
- Documented in Windows/WIndows Controls/RichEdit/CRichEditOleCallback Class.md
- Topic: CRichEditOleCallback Class