Skip to main content
Known Participant
August 19, 2014
Question

Getting incorrect values for linkQueryResult (ILinkManager) while debugging our plugin in Adobe InDesign CC debug

  • August 19, 2014
  • 2 replies
  • 462 views

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

This topic has been closed for replies.

2 replies

Inspiring
August 21, 2014

Hi Vimala L,

try to replace

ILinkManager::QueryResult linkQueryResult;

by

UIDList linkQueryResult(db);

Markus

Known Participant
August 21, 2014

Hi Markus,

Thanks a lot.. It is working fine.

Vimala L

Another_Andrew
Inspiring
August 19, 2014

I encountered something similar to this. I noticed that I had to make a slight change when porting to CS6.

LinkQuery Query;

Query.SetLinkType(ILink::kImport);

I think you need to specify the type of link that you're interested in for your query.

I think in release a default is being provided (which is why it works) while debug it is some invalid value (which is why it fails).

Known Participant
August 21, 2014

Hi,

Thanks for your reply..We have tried this solution, but we could not find the correct values for linkQueryResult. Still we are getting the same incorrect values in linkQueryResult.

Please help us to fix this issue.

Thanks,

Vimala L