The Initialize method is called to initialize the IsCheckedOut command, by specifying the object store item for which to determine if the item is checked-out by the current user.
void spIIsCheckedOutCmd->Initialize(IObjectStoreItemPtr pIObjectStoreItem);
NOTE When the pIObjectStoreItem parameter is not configured with a reservation ID, the IIsCheckedOutRsp::GetIsCheckedOut method will return true, even if a document is checked out and the Initialize method was configured with the current, released or superseded version of the object.
...
// Instantiate the custom IsCheckedOut command component
IIsCheckedOutCmdPtr spIIsCheckedOutCmd;
hResult = spIIsCheckedOutCmd.CreateInstance(__uuidof(IsCheckedOutCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the IsCheckedOut command component.\n";
_ASSERTE(0);
}
// Instantiate the ObjectStoreItem component
IObjectStoreItemPtr pIObjectStoreItem;
hResult = spIObjectStoreItem.CreateInstance(__uuidof(ObjectStoreItem));
if (FAILED(hResult)) {
std::cout << "Could not create the ObjectStoreItem component.\n";
_ASSERTE(0);
}
// Initialize the ObjectStoreItem component with
// the items' type, object store name, version series ID and item ID
ItemType enItemType = eItemTypeDocument;
_bstr_t bstrObjectStoreName = (_T("Alaska"));
_bstr_t bstrVersionSeriesID = (_T("{6BC064A2-2D58-4B0A-AEF2-B2F8A1100000}"));
_bstr_t bstrVersionID = (_T("{DDE54469-36D9-4fe9-8676-445E4994DE1F}"));
std::cout << "Initializing the ObjectStoreItem component..." << std::endl;
spIObjectStoreItem->Initialize(enItemType, bstrObjectStoreName, bstrVersionSeriesID, bstrVersionID);
// Initialize the custom IsCheckedOut command component with
// the object store item, for which to determine
// if it is checked out by the current user.
std::cout << "Initializing the IsCheckedOut command component..." << std::endl;
spIIsCheckedOutCmd->Initialize(pIObjectStoreItem);
...