CloseDocument not closing subsequent documents (MDI)

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

GregWente
User
Posts: 9
Joined: Wed May 05, 2010 6:26 pm

CloseDocument not closing subsequent documents (MDI)

Post by GregWente »

The CloseDocument(ID) will not release the opened documents and I must CloseAllDocuments before they will release.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: CloseDocument not closing subsequent documents (MDI)

Post by Vasyl - PDF-XChange »

Hi, GregWente.

It may occur because CloseDocument() is asynchronous - it closes the document view, release all internal objects but may keep captured the source file for some short time (file may be captured by background rendering thread that cannot be stopped without any waiting). If you want the guaranteed release of source file (it may wait for stop some background processes) - use it:

Code: Select all

pdfViewer.SetDocumentProperty(docID, "SyncClose", 1, 0);
pdfViewer.CloseDocument(docID);
HTH.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.