Release resources after loading an other pdf


the following scenario makes me mad:

I loaded a pdf document looked at it and want to load an other pdf
On the application side everything works fine.
The ofirst document is unloaded form and the second is loaded into the

But If I try to change the name of the first document (via win
explorer) the os tells me the application still
holds a reference to the document.

What do I need to do to cut all references to a document after it had
been unloaded from the viewer?


You would need to close (or dispose - it is the same thing) the
original document. Similar to PDFViewSimple sample (http://

For example:

PDFDoc old = pdfview.GetDoc();
pdfview.SetDoc(new PDFDoc(filename));
if (old != null) old.Dispose();