IRepository::CreateObject
This method creates the first version of a new repository object. The specified COM interface pointer to the new object is passed back to the caller.
HRESULT CreateObject(
VARIANT sTypeId,
VARIANT sObjId,
IRepositoryObject **ppIReposObj
);
Parts
sTypeId
[in]
The type of the new object; that is, the object identifier of the class definition to which the new object conforms.
sObjId
[in]
The object identifier to be assigned to the new object. Pass in OBJID_NULL to have the repository engine assign an object identifier for you.
*ppIReposObj
[out]
The IRepositoryObject interface pointer for the new repository object.
Return Value
S_OK
The method completed successfully.
This method failed to complete successfully.
Remarks
The new object will automatically create persistent storage for itself.
You can use this method only to create the first version of a repository object. To create subsequent versions of the object, use IRepositoryObjectVersion::CreateVersion.
This method can only be called from the shared repository. It cannot be called from a workspace. The workaround is to create the object through the central repository and include it in the workspace.