jai essayé ca, mais la fonction gethostname me renvoi -1 (WSAEFAULT).
ma fonction
String recupHostName()
{
char hostname[255];
struct hostent *he;
//memset(hostname,0,255);
int test = gethostname(hostname, 255);
switch (test)
{
case WSAEFAULT : break;
case WSANOTINITIALISED : break;
case WSAENETDOWN : break;
case WSAEINPROGRESS : break;
default : break;
}
if (test == 0)
{
//mettre Erreur
return -1;
}
hostname[HOST_NAME_MAX - 1] = '\0';
he = gethostbyname (hostname);
if (he == NULL)
{
//mettre Erreur
return -1;
}
return he->h_name;
}
---------------
-= Team RC5-72 =- -= Team Dolphin Project =-