UINT GetDlgItemText(
HWND hDlg, // handle of dialog box
int nIDDlgItem, // identifier of control
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum size of string
);
That should work fine.
And one more thing, you don't need to convert th ip from the text box to a char array, this function does it automatically for you. Later, you may want to convert the array to int, or ip address struct.