Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

TCPNameToIP issue

$
0
0
Howdy,

Trying to figure out why this little chunk of code isn't working, specifically trying to resolve a hostname to an IP..

[ autoit ]      
Func On_Button()     Switch @GUI_CTRLID   Case $GetIP    TCPStartup()    $SelectedComp = _GUICtrlListBox_GetText($CompListBox, _GUICtrlListBox_GetCurSel($CompListBox))    $ipAddress = TCPNameToIP($SelectedComp)    If @error Then          MsgBox(4112, "Error", "Couldn't Resolve IP Address, error#: " & @error)  Else    MsgBox(48, "Success", $SelectedComp & $ipAddress)    TCPShutdown() EndIf  EndSwitch EndFunc

If I replace $SelectedComp with the name of a computer (not using a variable) it works fine.  I'm not sure why it won't work using the variable, however.  $SelectedComp comes back as expected when an item is selected in the list box I have created.  The @error message I receive from my debug box is 11004.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>