Antwise community forums
VB6: OnNavigationCompleted issue - 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: OnNavigationCompleted issue (/showthread.php?tid=111)



VB6: OnNavigationCompleted issue - MrPrzemek - 2022-04-19

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


RE: VB6: OnNavigationCompleted issue - wila - 2022-04-19

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


RE: VB6: OnNavigationCompleted issue - MrPrzemek - 2022-04-19

(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