|
IStorage::CopyTo
Copies the entire contents of this open storage object into another storage
object.
HRESULT CopyTo(
DWORD ciidExclude,
| //Number of elements in rgiidExclude
| IID const * rgiidExclude,
| //Array of interface identifiers (IIDs)
| SNB snbExclude,
| //Points to a block of stream names in the storage object
| IStorage * pstgDest
| //Points to destination storage object
| );
|
|
Parameters
ciidExclude
[in]The number of elements in the array pointed to by rgiidExclude. If rgiidExclude is NULL, then ciidExclude is ignored.
rgiidExclude
[in]Specifies an array of interface identifiers the caller takes
responsibility for copying from the source to the destination. This array can include
interfaces that this storage object does not support. It can be NULL, indicating that
all other interfaces are to be copied. If non-NULL, an array length of zero
indicates that no other interfaces are to be copied, only the state exposed by
the IStorage object.
snbExclude
[in]Specifies a block of elements in this storage object that are not to be
copied to the destination. These elements are not created in the destination. If
IID_IStorage is in the rgiidExclude array, then this parameter is ignored. This parameter may be NULL.
pstgDest
[in]Points to the open storage object into which this storage object is to be
copied. The destination storage object can be a different implementation of the IStorage interface from the source storage object. Thus, IStorage::CopyTo can only use publicly available methods of the destination storage object. If pstgDest is open in transacted mode, it can be reverted by calling its IStorage::Revert method.
Return Values
S_OK
The storage object was successfully copied.
STG_S_DESTLACKSINTERFACE
The destination lacks an interface that the source requested to be copied. The
lack of an interface does not prevent other parts of the copy operation to be
successfully completed.
STG_E_ACCESSDENIED
The destination storage object is a child of the source storage object.
STG_E_INSUFFICIENTMEMORY
The copy was not completed due to a lack of memory.
STG_E_INVALIDPOINTER
The pointer specified for the storage object was invalid.
STG_E_INVALIDPARAMETER
One of the parameters was invalid.
STG_E_TOOMANYOPENFILES
The copy was not completed because there are too many open files.
STG_E_MEDIUMFULL
The copy was not completed because the storage medium is full.
Comments
This method merges elements contained in the source storage object with those
already present in the destination. The layout of the destination storage
object may differ from the source storage object.
The copy process is recursive, invoking IStorage::CopyTo and IStream::CopyTo on the elements nested inside the source.
If an attempt is made to copy a stream on top of an existing stream with the
same name, the existing destination stream is first removed and then replaced
with the source stream. Attempting to copy a source storage object on top of an
existing destination storage object does not remove the existing storage. Thus,
after the copy operation, the destination IStorage contains older elements if they were not replaced by newer ones.
Note to Callers
The following example illustrates using the CopyTo method to copy everything possible from the source to the destination:
pstg->CopyTo(0, Null, Null, pstgDest)
This is the most commonly used form of this operation, used in most Full Save
and SaveAs scenarios.
See Also
IStorage::MoveElementTo, IStorage::Revert
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|