Hi Greg,
I don't have PowerBuilder installed at this moment, but in VB6 the code to get cookies for a current URL looks like this (this is using AntView version 2.x code, so slight changes will be needed for AntView version 1.x - anything AntviewAx2 then should be AntviewAx )
So in summary, you have to first create an object based on the AntViewCookiemanager interface.
Once you want to use that, assign the WebBrowser object IDispatch pointer of the cookiemanager to your object and invoke the GetCookies method with the URL from the currently browsed page.
The OnGetCookieList event from the Cookiemanager object is where you can enumerate the cookies.
The Args parameter contains a AntViewCookieList object that has a list with all the cookies.
Hope this helps,
--
Wil
I don't have PowerBuilder installed at this moment, but in VB6 the code to get cookies for a current URL looks like this (this is using AntView version 2.x code, so slight changes will be needed for AntView version 1.x - anything AntviewAx2 then should be AntviewAx )
Code:
Option Explicit
Public WithEvents CookieManager As AntviewAx2.AntViewCookieManager
'
Private Sub CookieButton_Click()
' click
Set CookieManager = EdgeWebBrowser.CookieManager
CookieManager.GetCookies EdgeWebBrowser.Source
End Sub
Private Sub CookieManager_OnGetCookieList(ByVal HResult As Long, ByVal Args As AntviewAx2.IAntViewCookieList)
Dim ndx As Integer
Dim Cookie As AntviewAx2.AntViewCookie
If HResult = 0 Then
If Args.Count > 0 Then
For ndx = 0 To (Args.Count - 1)
Set Cookie = Args.ValueAtIndex(ndx)
If (Cookie.Name <> "") Then
MsgBox "name " & Cookie.Name & " = " & Cookie.Value, vbOKOnly, "Cookie " & CStr(ndx + 1) & " of " & CStr(Args.Count)
End If
Next
Else
MsgBox "No Cookies have been set for this site.", vbOKOnly, "Cookies"
End If
End If
End Sub
So in summary, you have to first create an object based on the AntViewCookiemanager interface.
Once you want to use that, assign the WebBrowser object IDispatch pointer of the cookiemanager to your object and invoke the GetCookies method with the URL from the currently browsed page.
The OnGetCookieList event from the Cookiemanager object is where you can enumerate the cookies.
The Args parameter contains a AntViewCookieList object that has a list with all the cookies.
Hope this helps,
--
Wil