Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How get active Document?

Enthusiast ,
Jun 30, 2016 Jun 30, 2016

UIDRef docUIDRef =GetDocumentUIDRef(widget); // Result: fDB=0x05ccc310, fID=1

InterfacePtr<IDocument> document(docUIDRef, UseDefaultIID());

Occur error:

__vfptr = CXX0030: Error: expression cannot be evaluated

But i open file from sdk, it is ok.

IDFile fSysFile;

FileUtils::PMStringToIDFile("D:\\test.indd", fSysFile);

SDKLayoutHelper layoutHelper;

UIDRef docUIDRef  =layoutHelper.OpenDocument(fSysFile);

InterfacePtr<IDocument> document(docUIDRef, UseDefaultIID());

How get active Document?

Thanks

TOPICS
SDK
535
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 01, 2016 Jul 01, 2016

You could use the ILayoutUIUtils to get a reference to the active document. The code would be like below

iDocument *iDoc = Utils<ILayoutUIUtils>()->GetFrontDocument();

-Manan

Translate
Community Expert ,
Jul 01, 2016 Jul 01, 2016
LATEST

You could use the ILayoutUIUtils to get a reference to the active document. The code would be like below

iDocument *iDoc = Utils<ILayoutUIUtils>()->GetFrontDocument();

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines