I am using the following code in my toolbar button handler to allow the user to use your InsertPages UI:
Code: Select all
object dataIn = null, dataOut = null;
viewer.DoVerb("Documents[0]", "InsertPages", dataIn, out dataOut, 0);
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Code: Select all
object dataIn = null, dataOut = null;
viewer.DoVerb("Documents[0]", "InsertPages", dataIn, out dataOut, 0);
Please wrap each call of DoVerb(and any other our method) into try/except brackets. Because when user canceled the dialog then DoVerb returns the 'ERROR_USER_CANCEL' error-code and standard COM-stub generates an exception on that.This works fine except for generating a COMException when the user clicks Cancel.