I get a strange error complaining about stack corruption I'm assuming, and I have debugged it a bit but I haven't found out the issue. I also can't seem to implement nothrow in Visual Studio 2010!
XYZ::XYZ(char * d)
{
hostname = new char[HOSTNAME_LENGTH];
ip = new char[IP_ADDR_LENGTH];
/*Dynamic Memory*/
memset(hostname, 0, HOSTNAME_LENGTH);
memset(ip, 0, IP_ADDR_LENGTH);
//strncpy(hostname, d, HOSTNAME_LENGTH);
if(dWSAStartup(MAKEWORD(2,2), &wsd) == 0) //Crashes Here!
//And so on..
dWSAStartup is dynamically linked from ws2_32.dll and has correct function parameters typecasted:
typedef int (*WSAS)(WORD, LPWSADATA); //WSAStartup
And no, the FreeLibrary function hasn't been called -- so the function pointer IS valid!
This bug is the only thing stopping me! Would anyone throw me a pointer?