The Initialize method initializes the LinkDescriptor component for use by the Add or AddViaTemplate command, by specifying the object store item to be linked, the link class to use when creating the linked object, and the relationship between the two linked objects (that is, which link is the head and which is the tail).
void spILinkDescriptor->Initialize(IObjectStoreItemPtr pIObjectStoreItem, _bstr_t bstrLinkClassID, RelationshipType enLinkType, _bstr_t bstrPropertiesXml);
eTypeLinkTo
, indicates that the object store item will
be the first or head in the link object.eTypeLinkFrom
, indicates that the object store item will
be the last or tail in the link object.VT_EMPTY
should be specified. ...
// Initialize the LinkDescriptor component to hold the link
std::cout << "Initializing LinkDescriptor component 1..." << std::endl;
spILinkDescriptor0->Initialize(spIObjectStoreItem0, bstrLinkClassID, enLinkType, bstrPropertiesXml);
if(spILinkDescriptor0) {
saLinks.PutElement(&lCount, spILinkDescriptor0);
}
...