Probleme mit ExecUICmd2

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
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Probleme mit ExecUICmd2

Post by apx »

Hello Tracker Software Team,

I am currently trying to integrate the PDF control from the PDF Editor SDK into our application and unfortunately I have some problems
when calling the function ExecUICmd2 () (https://sdkhelp.pdf-xchange.com/vie ... ExecUICmd2)

Unfortunately, I always get an error message in my application when calling the function and I don't know why.
Parallel I have your demo application FullDemo written in C#. There the call works without problems.
Is there anything else that needs to be initialized that I miss?


Code: Select all

oleobject lo_cmd
STRING  as_command
STRING	ls_langCode
LONG ll_cmdId

pdfCtl.object.SetLicKey ( is_licKey ) // working
pdfCtl.object.VisibleCmdPanes = PXV_VisibleCmdPanes_None // working

// as_command = "cmd.open"
as_command = "cmd.view.goto.firstPage"

lo_cmd = CREATE oleobject
lo_cmd = io_uiInst.CmdManager.Cmds.Find(as_command)  // Working
ll_cmdId = lo_cmd.ID // 3460 same as in the c# fulldemo application

ls_langCode = pdfCtl.object.Inst.GetCurrentUILang() // Working

// Test 1
pdfCtl.object.Inst.ExecUICmd2 ( ll_cmdId, lo_pOwner ) // "Error calling external object function execuicmd2"

// Test 2
pdfCtl.object.Inst.ExecUICmd2 ( ll_cmdId )            // "Error calling external object function execuicmd2"

// Test 3
pdfCtl.object.Inst.ExecUICmd2 ( 3460 )            // "Error calling external object function execuicmd2"

// Test 4
pdfCtl.object.Inst.ExecUICmd2 ( lo_cmd.ID )            // "Error calling external object function execuicmd2"

// Test 5 - unknown function to test error 
pdfCtl.object.Inst.ExecUICmd12 ( lo_cmd.ID )            // "Name not found calling external object function execuicmd12"



I would be grateful for any help.

Greetings
Alex
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Probleme mit ExecUICmd2

Post by Sasha - Tracker Dev Team »

Hello Alex,

Have you tried using the ExecuteUICmd method with string as an argument?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Re: Probleme mit ExecUICmd2

Post by apx »

Hello Sasha,

yes I tried the ExecUICmd, but with the same result.
I have already passed the variable as a reference for testing, but also without success. It is not a complex object that is passed, but only a simple int. That's why I'm so confused. Do you have to initialize anything special that is done in the FullDemo, but I haven't found anything yet?

Other things are working. I turn off the toolbars, load a PDF document and retrieve the language works.
pdfCtl.object.Inst.GetCurrentUILang() gives me "de-DE", so "pdfCtl.object.Inst" is basically accessible.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Probleme mit ExecUICmd2

Post by Sasha - Tracker Dev Team »

Hello Alex,

Well, this command requires a document to be opened - try doing that - the exception can be caused because the document is NULL.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Re: Probleme mit ExecUICmd2

Post by apx »

I put the problem on hold for now. Right now I'm helping myself with a wrapper I created C#. There the same source code works without problems.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Probleme mit ExecUICmd2

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply