Copy link to clipboard
Copied
Hello,
After i could successfully get XmlNodeTarget on user selection as the below
InterfacePtr<IXMLNodeTarget> xmlNodeTarget(runnableContext, UseDefaultIID());
if(xmlNodeTarget) {
snpInspectSelectionXML.Inspect(xmlNodeTarget -> GetAllNodeList ());
}
the code is not executable or debuggable on the inspect functions:
void SnpInspectSelectionXML::Inspect(const K2Vector<XMLReference>& elements)
{
do {
K2Vector<XMLReference>::const_iterator iter;
for (iter = elements.begin(); iter != elements.end(); iter++) {
XMLReference nextXMLRef = *iter;
this->Inspect(nextXMLRef);
}
} while (kFalse);
}
/*
*/
void SnpInspectSelectionXML::Inspect(const XMLReference& xmlRef)
{
do {
InterfacePtr<IIDXMLElement> element(xmlRef.Instantiate());
if (!element) {
break;
}
} while (kFalse);
}
Can i please know why or what conditions i miss to make code executable on inspect functions?
Many Thanks.
Copy link to clipboard
Copied
That InterfacePtr<> in the first line is an object which mainly holds a pointer (in member variable fFace).
When in the debugger, open the object and see whether the contained pointer fFace is NULL.
In that case your "if(xmlNodeTarget)" fails and the method never executes.
Add an appropriate "else … alert … ".
Maybe you attempt to access the target at the selection ASB instead of the CSB?
For details, see the programming guide …
Copy link to clipboard
Copied
Thanks for your reply, i am not in ASB and the execution pass the if statement successfully, the problem in the body of the Inspect method only, not executable and not debuggable, i read all the documentation and i didnt find any related information for what i am facing, i had to move the inspect body logic after the if statement directly and it worked so far, what i cant understand why its fail to call the inspect function after the If statement.