ITcSmTreeItem::ImportChild
Imports a child from an XML/XTI file. The file is loaded; the system checks whether the loaded item can be inserted as a child or, if applicable, as a sibling; the item is inserted; modified flags are set; variable IDs are reassigned; and mappings are restored as needed.
Signature
HRESULT ImportChild(BSTR bstrFile, BSTR bstrBefore, VARIANT_BOOL bReconnect, BSTR bstrName, ITcSmTreeItem** pipItem);
Parameter
|
Name |
Type |
Description |
|---|---|---|
|
bstrFile |
BSTR |
[in, defaultvalue(L"")] File from which to import. |
|
bstrBefore |
BSTR |
[in, defaultvalue(L"")] Optional cursor name before which the insertion will take place. |
|
bReconnect |
VARIANT_BOOL |
[in, defaultvalue(-1)] If not set to |
|
bstrName |
BSTR |
[in, defaultvalue(L"")] Optional new name for the imported item. |
Return value
|
Name |
Type |
Description |
|---|---|---|
|
pipItem |
ITcSmTreeItem** |
[out, retval] Imported Tree Item. |
|
(HRESULT) |
HRESULT |
|
Error codes
-
NTE_NOT_FOUND: An importable item could not be created. -
TSM_E_ITEMNOTFOUND: The specifiedbstrBeforecursor was not found. -
E_FAIL: XML loading, class checking, or insertion failed. Details are provided in the COM error message. -
E_ACCESSDENIED: The associated file must not be edited. -
TSM_E_ITEMDELETED: The referenced Tree Item is no longer valid.