Exit Application File Menu

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Exit Application File Menu

Post by edvschu »

Hello,

i want exit app by cmd button in file menu.

In full demo there is a command "cmd.exit". When Turn ON and Show no button is visible. When Execute command nothing happens.

Then i add my own exit button in file menu and assign "cmd.exit", but does not work too.

In End User PDF Editor there is exit button in file menu. But how do I get this with SDK?

Best Regards,
edvschu
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Exit Application File Menu

Post by Sasha - Tracker Dev Team »

Hello edvschu,

The Exit command works only for the End-User Editor because control is a part of the form and the closing should be handled by the developer.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
edvschu
User
Posts: 127
Joined: Fri Jun 25, 2010 6:54 am

Re: Exit Application File Menu

Post by edvschu »

Hello Alex,

can you give me a hint, how can i handle close the main form from command handler? Calling Close() leads to a AccessViolationException.

Code: Select all

Public Sub OnNotify(nCode As Integer, pCmd As PDFXEdit.IUIX_Cmd, pItem As PDFXEdit.IUIX_CmdItem, pOwner As PDFXEdit.IUIX_Obj, nNotifyData As UInteger) Implements PDFXEdit.IUIX_CmdHandler.OnNotify
    If pCmd.ID = m_nMyExitID Then
 		m_MainForm.Close()
 	End If
End Sub
Regards,
edvschu
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Exit Application File Menu

Post by Sasha - Tracker Dev Team »

Hello edvschu,

Well you are attempting to close the form from within the Editor's handler, meaning that you are attempting to destroy the parent of the Editor's Control while the Control itself is still alive that's why the exception occur.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply