Howdy,
Trying to figure out why this little chunk of code isn't working, specifically trying to resolve a hostname to an IP..
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.
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.