-
url monitoring
hi, i used DDE for url monitoring in a vb6 program i had... it worked perfectly and still does.. now am upgrading the project to 2008 and it upgrades rest of the parts except DDE... What alternatives should i use?? i have read about ndde but have no idea how to implement it... please Suggest and help...
here is the vb6 code
Code:
Option Explicit
Private txtMon As Object
Public LastURL As String
Public WithEvents myTimer As Timer
Public Active As Boolean
Public Event TitleChanged(Title As String)
Public Event URLChanged(URL As String)
Private WithEvents MTimer As Timer
Private Sub LinkTextBox(ByRef pTextBox As TextBox, plinkTopic As String, plinkMode As LinkModeConstants, plinkItem As Variant)
On Local Error GoTo listen:
pTextBox.LinkTopic = plinkTopic
pTextBox.LinkTimeout = 10
pTextBox.LinkMode = plinkMode
pTextBox.LinkItem = plinkItem
pTextBox.LinkRequest
listen:
On Error GoTo 0
End Sub
Public Sub GetDDEURL(LinkTopic As String)
Dim sTmp As String, sLink() As String
Call LinkTextBox(txtMon, LinkTopic, vbLinkManual, &HFFFFFFFF)
sTmp = Mid(txtMon.Text, 2)
sLink = VBA.Split(sTmp, """,""")
If UBound(sLink) > 0 Then
If VBA.Left(sLink(0), 1) = """" Then
sTmp = Mid(sLink(0), 2, Len(sLink(0)) - 1)
Else
sTmp = sLink(0)
End If
If sTmp <> LastURL Then
RaiseEvent URLChanged(sTmp)
LastURL = sTmp
If sLink(1) <> "" Then
If VBA.Right(sLink(1), 1) = """" Then
sTmp = VBA.Left(sLink(1), Len(sLink(1)) - 1)
Else
sTmp = sLink(1)
End If
RaiseEvent TitleChanged(sTmp)
End If
End If
End If
End Sub
Public Sub StartMon(TextBoxCtl As Object, myTimer As Object)
Set txtMon = TextBoxCtl
myTimer.Interval = 500
myTimer.Enabled = True
End Sub
Public Sub StopMon()
myTimer.Enabled = False
End Sub