I tried the sample code from the sample eCom but I got blank strings for hostName and hostAddress.Was I missing something?Also I can't help but suggest you use the Ecere functions instead of the WinSock API directly, to fulfill Ecere's aspiration for cross-platform applications:
GetAddressFromName, GetNameFromAddress and GetHostName will help you do what you're doing here with much ease.
Code: Select all
Button button1
{
this, text = "button1", position = { 184, 112 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
char hostName[256], address[64];
GetHostName(hostName, sizeof(hostName));
GetAddressFromName(hostName, address);
MessageBox{contents=hostName}.Modal();
MessageBox{contents=address}.Modal();
return true;
}
};