Here is an sample of the code :
Code: Select all
Private Sub frmPDFXViewer_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
AxPDFXviewer.CloseAllDocuments(PDFXCviewAxLib.PXCVA_Flags.PXCVA_NoUI)
SupprimerPdfCourant()
Catch ex As System.Runtime.InteropServices.COMException
If System.Runtime.InteropServices.Marshal.GetHRForException(ex) = -2112683532 Then
'Je laisse passer cette erreur puisque cela n'en devrai pas être une.
'L'utilisateur a quitté le dialog pour imprimer
ElseIf System.Runtime.InteropServices.Marshal.GetHRForException(ex) = -2081159993 Then
'Je laisse passer cette erreur puisque cela n'en devrai pas être une.
'L'utilisateur a quitté le dialog précis de l'imprimante choisi
ElseIf System.Runtime.InteropServices.Marshal.GetHRForException(ex) = -2112673933 Then
'aucun document n'est ouvert
Me.Close()
Else
Throw New Exception(EasyDealChangeLanguage.Instance.GetStringFromResourceName("1271"), GetDetailComException(ex))
End If
Catch ex As Exception
Throw ex
End Try
i closed the document.
However, i still got the error "cannot access file (in use)" when i try to delete the file..
I remark that if i enter in the debug mode and i browse the line
the error doesn't occur.Can the problem be at your side?? maybe the closing document function is just not closing fastly or doesn't freeing the document at 100%... Or Maybe is just that the process need to be on a waiting..
What do you think?