CWebStorage::MoveObject Method  
 
BOOL MoveObject(
  LPCTSTR lpszOldLabel,  
  LPCTSTR lpszNewLabel,  
  DWORD dwStorageType,  
  LPWEB_STORAGE_OBJECT lpObject  
);

The MoveObject method moves an existing object to a different storage container.

Parameters

lpszOldLabel
A null-terminated string which specifies the name of the existing storage object to be moved. This parameter must specify a valid object label and cannot be a NULL pointer or an empty string.
lpszNewLabel
A null-terminated string which specifies a new label for the storage object being moved. This parameter may be NULL or point to an empty string, in which case the label name is not changed.
dwStorageType
An integer value that identifies the storage container type. If this parameter is omitted, the object is renamed and not moved to another container. One of the following values may be specified:
Value Description
WEB_STORAGE_GLOBAL Global storage. Objects stored using this storage type are available to all users. Any changes made to objects using this storage type will affect all users of the application. Unless there is a specific need to limit access to the objects stored by the application to specific domains, local machines or users, it is recommended that you use this storage type when creating new objects.
WEB_STORAGE_DOMAIN Local domain storage. Objects stored using this storage type are only available to users in the same local domain, as defined by the domain name or workgroup name assigned to the local system. If the domain or workgroup name changes, objects previously stored using this storage type will not be available to the application.
WEB_STORAGE_MACHINE Local machine storage. Objects stored using this storage type are only available to users on the same local machine. The local machine is identified by unique characteristics of the system, including the boot volume GUID. Objects previously stored using this storage type will not be available on that system if the boot disk is reformatted.
WEB_STORAGE_USER Current user storage. Objects stored using this storage type are only available to the current user logged in on the local machine. The user identifier is based on the Windows user SID that is assigned when the user account is created. If the user account is deleted, the objects previously stored using this storage type will not be available to the application.
lpObject
A pointer to a WEB_STORAGE_OBJECT structure that will contain information about the new storage object. If this information is not required, this parameter may be omitted or a NULL pointer.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call the GetLastError method.

Remarks

The MoveObject method is used to move an existing storage object to a new container. For example, it can move an object originally created using WEB_STORAGE_USER to the WEB_STORAGE_MACHINE container. The dwStorageType parameter must specify a valid storage container type and cannot be WEB_STORAGE_DEFAULT.

If the dwStorageType parameter specifies the same container that the object is currently in, and the lpszNewLabel parameter specifies a new label name, this method will simply rename the existing object and is effectively the same as calling the RenameObject method.

To duplicate an existing storage object, use the CopyObject method.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cswebv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also