Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[VB6] NavigateWithWebResourceRequest not working
#1
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
Reply
#2
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
Reply
#3
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)