Hello,
I have the following code:
Utils<Facade::ILinkFacade> linkFacade;
K2::UIFlags uiFlags = K2::UIFlags::kSuppressUI;
ErrorCode relinkResult = linkFacade->RelinkLink(linkRef,
newLinkURI,
uiFlags,
linkUID);
InterfacePtr<constILink> theLink(database, linkUID, UseDefaultIID());
InterfacePtr<constILinkResource> theLinkResource(database, linkResourceUID, UseDefaultIID());
ISession *mySession = GetExecutionContextSession();
InterfacePtr<IK2ServiceRegistry> serviceR(mySession, UseDefaultIID());
IK2ServiceProvider *nameSvc = serviceR->QueryServiceProviderByClassID(kLinkInfoService,
kLinkInfoNameProviderBoss);
InterfacePtr<constIK2ServiceProvider> nameProvider(nameSvc);
InterfacePtr<ILinkInfoProvider> nameInfoService(nameProvider, UseDefaultIID());
PMString linkImageFileName = nameInfoService->GetUpdatedInfoForLink(theLink,
theLinkResource,
true); // This now gives an empty string.
But after a relink, linkImageFileName is an empty string. How is that possible and what do I need to do in order to read the filename AFTER a relink?
I think it may be due to the fact that the document has not been saved and that the updated info is not in the document database?
Thanks in advance.. Regards, Jan