Olewebbrowser exception despite errorhandler

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
ic2
Posts: 1968
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Olewebbrowser exception despite errorhandler

Post by ic2 »

In a VO window we show a preview of a PDF invoice using the WebView2 browsers. This has worked for years, but recently 2 users (out of many on the same server) reported a VO runtime error (intermittent) showing:

No errorblock
Error in Errorhandler
OLEWEBBROWSER:NAVIGATE2() line 49

Line 49 is generated OLE code

Code: Select all

	uRetValue := SELF:oAuto:__InvokeMethod(a, DWORD(_BP+16),PCount())
As the preview is not really critical I added a VO errorblock, as follows:

Code: Select all

cobOldErrFunc := ErrorBlock( {|oErr|_Break(oErr)} )
BEGIN SEQUENCE
	IF SELF:oDCcbPreView:Checked
           SELF:oDCPreView:Navigate2(cFile)
         ENDIF                                                          			
RECOVER  // Just do nothing to recover
END SEQUENCE                                                         			
ErrorBlock(cobOldErrFunc)
That seemed to help for 2 weeks, they either got a preview or not, so the errorhandler must have absorbed the hard-to-solve intermittent Naivagate2 exception. Until Friday, 2 weeks later, one of the users got the very same error again, despite the errorhandler which has worked until then.

1 How can the exact same error re-appear despite the error handler>
2 And even better, is there a way to find the cause of the error? There is no reason to assume anything has changed or anything wrong is 'fed' to Navigate2...

Dick
User avatar
robert
Posts: 4918
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Olewebbrowser exception despite errorhandler

Post by robert »

Dick,
1 How can the exact same error re-appear despite the error handler>
No idea. Are you sure that the customer is running the new version of the EXE?
> And even better, is there a way to find the cause of the error? There is no reason to assume anything has changed or anything wrong is 'fed' to Navigate2...
That webbrowser is the Internet Explorer control. It is very well possible that Ms has changed something to fix a security issue

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1968
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Olewebbrowser exception despite errorhandler

Post by ic2 »

Hello Robert,
No idea. Are you sure that the customer is running the new version of the EXE?
Indeed my first thought too. But they sent a screenprint of the About window with the latest version number in it.

That webbrowser is the Internet Explorer control. It is very well possible that Ms has changed something to fix a security issue
Is is actually not IE, but Edge (without the need to have Edge installed. Interesting detail: later European W10 versions were forced by EU rules to allow to de-install Edge in which case WebView2 keeps working).

I also think the cause must be in the component but a server wide update should yield the same issue for every user.
My main concern is that the error handler seem to have worked as I expected 2 weeks ago and it stopped doing that.

Dick
User avatar
ArneOrtlinghaus
Posts: 486
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Re: Olewebbrowser exception despite errorhandler

Post by ArneOrtlinghaus »

The Webview control uses multiple threads and so an error may be delayed.
Perhaps a delay of some seconds or asking for the contents of the returned page in a loop can help.
That's the way we got it stable:
Waiting some time, for example 1 s, then waiting in a loop, asking for the results with a sleep function of for example 0.1 s in between.
And this all wrapped in an error block

Arne
ic2
Posts: 1968
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Olewebbrowser exception despite errorhandler

Post by ic2 »

Hello Arne,

In a way it is good to see that you encountered the same issue ;) But I am not retrieving information from the Webview2 browser, so I can not use a delay for anything.

I see on https://learn.microsoft.com/en-us/previ ... 4(v=vs.85) that Navigate2 has a return value. I am going to check that value now although I would say that if the Navigate2 is responsible for the exception, it will never reach the check for a return value.

Dick
Post Reply