2112674030 error

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

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

Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

2112674030 error

Post by Christos101 »

Hi support

Been working on solving this problem for a few days but can't find the problem.

Here's the code that causes the error

s = "var annots = this.getAnnots();"

s = s & "if (annots!=null && annots.length!=0)"
''''s = s & "if (annots != null)"
s = s & "{"

s = s & "for (var i = 0; i < annots.length; i++)"
s = s & "{"
s = s & "var a = annots;"
s = s & "a.destroy();"
s = s & "}"

s = s & "}"

Viewer.RunJavaScript s

It is a vb6 activex control running in IE9 and IE11 on Windows 7.

Just can't seem to find the cause. I'm using pdf exchange veier activex 2.5.201 but also tried it with the latest version, still get the same problem.

it fails specifically at line 1 - s = "var annots = this.getAnnots();"

I had it working on my development machine but now I also see the problem the same as two customers.

HELP

Regards

Chris
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: 2112674030 error

Post by John - Tracker Supp »

Hi,

can you confirm that its also a problem now on your Dev machine that was working OK ?

Has the IE/Win version altered since it was working ?

Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

Correct, it doesnt work on my machine either. the fault is intermittant in that the it works OK about 20% of the time and the rest is a fail. The code hasnt changed in nearly 2 years. I'm using IE11, windows 7 with all the current O/S updates

The customer is using IE9
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3550
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: 2112674030 error

Post by Ivan - Tracker Software »

Are there any documents already open when you call "Viewer.RunJavaScript s" ?
when there is an open document, this.getAnnots() means the currently active document and its getAnnots() method, but when there are no open document, this refers to a global root object that has no such method and your code will not work.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

yes, document has been opened then that code i posted runs afterwards. all the files .pdf and .xfdf are there and i set the viewer to be on the current document i.e active document. If this doesnt work what should i use ? i got the method from the JS user guide !
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3550
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: 2112674030 error

Post by Ivan - Tracker Software »

can you open the JS console before you run your JS? It should show some additional information about the that error occurred.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

OK, what do i do to get the console up and running. i see there is a console methed ?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: 2112674030 error

Post by Tracker Supp-Stefan »

Hello Christos101,

With the Viewer control already running and if you are not filtering shortcuts to it - Ctrl-J should display the console

You can try RunJavaScript("console.show();"); from the source of your application.

Alternatively - you can enable any Viewer toolbar, richt click it and select "Customize...", locate the "JS Console" in the View category of commands - and add a button to it to the menu/toolbar, and then launch the console from the button.

Regards,
Stefan
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

OK thanks, i'll get back to you
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: 2112674030 error

Post by Tracker Supp-Stefan »

Looking forward to the feedback Christos101!

Cheers,
Stefan
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

Hi Stefan

for some strange reason I can't get the console to show. Any ideas ?

Regards

Chris
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

I added some debug code to see what is going on just before i use the getannots js.

Viewer.GetActiveDocument ActiveDoc

MsgBox "ActiveDoc=" & ActiveDoc

If (ActiveDoc < 0) Then
Exit Sub
End If


''s = "this.syncAnnotScan();"

s = "var annots = this.getAnnots();"

s = s & "if (annots!=null && annots.length!=0)"
''''s = s & "if (annots != null)"
s = s & "{"

s = s & "for (var i = 0; i < annots.length; i++)"
s = s & "{"
s = s & "var a = annots;"
s = s & "a.destroy();"
s = s & "}"

s = s & "}"

Viewer.RunJavaScript s

When all is working ActiveDoc = 4095

When it fails ActiveDoc = - 1 but the document is loaded

Any ideas ?

I should add that the fault is intermittent. my popup also hangs intermittently but i think this is a seperate issue.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3550
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: 2112674030 error

Post by Ivan - Tracker Software »

Do you have only one instance of the ActiveX created?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

yes just the one instance with a single document / single page.

i'm running it on another machine as well as would be installed at a customer and i get exactly the same problem but on the other machine it almost always hangs and i have to use task manager to shut the window down. on my machine it hangs 1 in 4 loads of the activex. i've tried it with the latest version as well 2.5.311 but no improvement.

Are there any specific dependancies i need to be aware of other than the files mentioned in the user guid for installtion / distribution ?
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3550
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: 2112674030 error

Post by Ivan - Tracker Software »

No, there are no any other dependencies.

Where exactly it hangs? You are writing on VB .NET or VB6 ?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

the browser code is written in c# which hosts an activex written in vb6 which in turn hosts the viewer. i can't where it hangs. the image is loaded, the annotations are loaded then the ie11 browser window hangs and i use task manager to shut it down.

i add some more debug code to see how far it gets / where its crashing and let you know.
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

ok. it seems to everything but right at the end ie11 / something locks up.

i added a simple

Open App.Path & "\errors.txt" For Output As #1
Print #1, "StartSession complete"
Close #1

which is the last thing that runs so pdf loaded, annotations loaded, toolbars set up etc.

Out of interest i have the following sub routine and not sure what it is used for or if its neccessary..

Public Sub Viewer_OnEvent(ByVal iType As Long, ByVal Name As String, ByVal DataIn As Variant, DataOut As Variant, ByVal Flags As Long)
' do nothing
Dim s

s = 0

End Sub

the strange thing is that i only see it frezzing every so often on my machine but on a different machine it is very reguraly i.e frezzes more times than it works
Christos101
User
Posts: 11
Joined: Thu Nov 20, 2014 5:02 pm

Re: 2112674030 error

Post by Christos101 »

OK some more info. I added some additional error trapping and i get the error...

Automation error

The object invoked has disconnected from its clients
.

Any ideas why it might do this intermittantly ? I'm sure this is where the problem is in terms of the freeze up of the browser. I'm locating the exact point where it happens.


So far as the getAnnots problem I've created a work around and that works fine now. i had to put it into a loop as follows. I'll probably refine that to around 200 attempts but so far that bit works fine.

ActiveDoc = 0

Do Until ActiveDoc = 4095
Viewer.GetActiveDocument ActiveDoc

DoEvents
Loop




Chris
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3550
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: 2112674030 error

Post by Ivan - Tracker Software »

Can you please check if the process 'PDFXCview.exe' exists when hang happens? End-user version of the Viewer should not be launched.

In regards your loop: can you try to call?

Code: Select all

ActiveDoc = 4095
Viewer.ActivateDocument ActiveDoc
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.