MSVC++ Is A Pain in the Ass!
Hi. Glad to get that out of my system. Compiler says, "ERROR". I say, "Why?" Compiler says, "ERROR".
Look, whenever I try to include the following file into my dialog file, it gives me the following error. I've investigated it and found no other definition of the class:
--------------------Configuration: DnD - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
DnDDlg.cpp
c:\program files\microsoft visual studio\myprojects\dnd\dndwinsock.h(6) :
error C2011: 'SockHead' : 'class' type redefinition
Generating Code...
Skipping... (no relevant changes detected)
DnD.cpp
Error executing cl.exe.
DnD.exe - 1 error(s), 0 warning(s)
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WINSOCK CRAP (dndwinsock.h)
#include <winsock.h>
class SockHead
{
public:
int InitiateSock()
{
char newName[200];
WSADATA wsadata;
WSAStartup(0x0101, &wsadata);
hostent *name = gethostbyname("http://www.angelfire.com");
sprintf(newName, "%d", name);
MessageBox(NULL,newName,"Title",NULL);
return 0;
}
int CloseSock()
{
WSACleanup();
return 0;
}
protected:
char newName[200];
private:
int NoneOfYourBusiness;
};