Getting incorrect values for linkQueryResult (ILinkManager) while debugging our plugin in Adobe InDesign CC debug
Hi,
We have added some functionalities in PanelTreeView sample source. In that, we are getting incorrect values for linkQueryResult (ILinkManager) while using InDesign CC debug. But in release version we are getting the correct values for linkQueryResult (ILinkManager). So when debugging our plugin InDesign CC debugger has stopped working. Please find the below source,
IDocument* document = Utils<ILayoutUIUtils>()->GetFrontDocument();
if(document == nil)
{
//CAlert::InformationAlert("Doc Interface Not Created");
break;
}
IDataBase *db = ::GetDataBase(document);
InterfacePtr<ILinkManager> linkmanager(document, UseDefaultIID());
if(linkmanager == nil)
{
//CAlert::InformationAlert("linkmanager Interface Not Created");
break;
}
LinkQuery Query;
ILinkManager::QueryResult linkQueryResult;
linkmanager -> QueryLinks(Query, linkQueryResult);
for (ILinkManager::QueryResult::const_iterator iter(linkQueryResult.begin()), end(linkQueryResult.end()); iter != end; ++iter)
{
InterfacePtr<ILink> iLink(db, *iter, UseDefaultIID());
if ( iLink )
{
InterfacePtr<ILinkResource> resource(linkmanager->QueryResourceByUID(iLink -> GetResource()));
ILinkResource::ResourceState rs = resource->GetState();
PMString fileName = resource -> GetLongName(kTrue); //gets full path
CharCounter lc=fileName.LastIndexOfCharacter('.');
PMString *exten = fileName.Substring(lc+1,3);
if((*exten).Compare(kFalse,"xml")==0)
{
xmlDataLinkName = fileName;
}
}
}
Kindly help us if anyone has idea regarding this issue.
Thanks,
VIMALA L