Antwise community forums
[VB6] NavigateWithWebResourceRequest not working - Printable Version

+- Antwise community forums (https://forums.antwise.com)
+-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11)
+--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12)
+--- Thread: [VB6] NavigateWithWebResourceRequest not working (/showthread.php?tid=138)



[VB6] NavigateWithWebResourceRequest not working - Bros - 2022-11-08

Hello

I'm using NavigateWithWebResourceRequest in a vb6 project.

The webpage showing is always "about:blank", but if I put a breakpoint on the line code with the call to NavigateWithWebResourceRequest and hit directly F5, the good webpage is showing.

The good webpage is also showing if I put a MSgBox juste befeore the NavigateWithWebResourceRequest call.

Do you have any idea for that error ?

Thank you


RE: [VB6] NavigateWithWebResourceRequest not working - wila - 2022-11-08

Hi,

Thank you for your question.

It should work as I ran a test and "it works for me".

Here's what I did:
I went to the examples and in particular the frmFillFormDemo form.
In that example code we changed the click event for the "Zoom In" button, from zooming in, into using the navigatewithWebResourceRequest to open a page at the antwise website, like so:



Code:
Private Sub ZoomInButton_Click()
  'EdgeWebBrowser.ZoomFactor = EdgeWebBrowser.ZoomFactor + 0.1
  EdgeWebBrowser.NavigateWithWebResourceRequest "https://www.antwise.com", "GET", "", ""
End Sub


Clicking on the zoom in button does result in the browser opening the main page at the antwise.com web site.

The question now is why did it not work for you.

Can you show me your code?

Or if it contains sensitive parts then please send it to me by email via support@antwise.com

thanks,
--
Wil


RE: [VB6] NavigateWithWebResourceRequest not working - wila - 2022-11-09

For anyone reading along.
This has been resolved by email.

The problem was due to a timing issue. The WebView2 control is created asynchronously and that sometimes makes things more difficult than you would expect.
The NavigateWithWebResourceRequest was called immediately on creation of the form and that caused issues.
This was resolved by moving the NavigateWithWebResourceRequest into the OnCreateWebViewCompleted event.

--
Wil