How to translate this VB6 code segment to Delphi?


2005-08-07 09:44:37 PM
delphi74
Can you help me how to translate the following VB6 code to Delphi?
Private Sub Timer1_Timer()
Set nicset =
GetObject("winmgmts:{impersonationLevel=impersonate}!root/wmi").InstancesOf("MSNdis_80211_ReceivedSignalStrength")
On Error GoTo no80211Error
For Each nic In nicset
SignalStrengthValue = Right(nic.Ndis80211ReceivedSignalStrength,
Len(nic.Ndis80211ReceivedSignalStrength) - 1)
If SignalStrengthValue <>"" Then
SendText ("S=NetSignalStrength~" & SignalStrengthValue)
End If
Exit For
Next
nicset = Nothing
Exit Sub
no80211Error:
SendToConsole "No 802.11 network adapters found"
Timer1.Enabled = False
End Sub