Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB6: OnNavigationCompleted issue
#1
I'm trying to set up event "OnNavigationCompleted" or "OnFrameNavigationCompleted" in IDE but an error window pops up
“Function or interface marked as restricted, or the function uses an automation type not supported in Visual Basic”

VB6 IDE: AntView private build v1.1.150.0.

By the way, "OnNavigationStarting" works fine

Code:
Private Sub EdgeWebBrowser_OnNavigationStarting(ByVal Args As AntViewAx.IAntViewNavigationStartingEventArgs)
Debug.Print Args.URI
End Sub

It seems that in VB6 it is not possible to determine whether a page has already been fully loaded

Do you have any idea how to fix it?

--
Przemek
Reply
#2
Hi Przemek,

That was indeed a problem in earlier versions.
The issue is that VB6 does not understand Int64 and as such the NavigationId parameter isn't understood because of the datatype Int64.

In the private beta build that you have there's an alternative version of that event called OnNavigationCompletedHex (and OnFrameNavigationCompletedHex) that passes the Int64 variable as a hexadecimal string instead.
You can use that event AFTER you set the property EventsUseHexadecimal to True.

Oh.. and you can convert the Hexadecimal parameter back to an integer using: 

NavigationId = Abs("&H" & NavigationIdHex)

Hope this helps,
--
Wil
Reply
#3
(2022-04-19, 11:52:32)wila Wrote: Hi Przemek,

That was indeed a problem in earlier versions.
The issue is that VB6 does not understand Int64 and as such the NavigationId parameter isn't understood because of the datatype Int64.

In the private beta build that you have there's an alternative version of that event called OnNavigationCompletedHex (and OnFrameNavigationCompletedHex) that passes the Int64 variable as a hexadecimal string instead.
You can use that event AFTER you set the property EventsUseHexadecimal to True.

Oh.. and you can convert the Hexadecimal parameter back to an integer using: 

NavigationId = Abs("&H" & NavigationIdHex)

Hope this helps,
--
Wil

THX. Yes your advice helped. This method works fine.

Code:
Private Sub EdgeWebBrowser_OnNavigationCompletedHex(ByVal IsSuccess As Boolean, ByVal WebErrorStatus As AntViewAx.TxWebErrorStatus, ByVal NavigationIdHex As String)
NavigationIdHex = Abs("&H" & NavigationIdHex)
Debug.Print "Index: " & NavigationIdHex & ". URL: " & EdgeWebBrowser.Source & ". Status: " & IsSuccess
End Sub


--
Przemek
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)