Click here to Skip to main content
15,928,330 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help! print issue Pin
bob1697231-Oct-06 6:52
bob1697231-Oct-06 6:52 
GeneralRe: Help! print issue Pin
hongmuer31-Oct-06 7:50
hongmuer31-Oct-06 7:50 
GeneralRe: Help! print issue Pin
bob1697231-Oct-06 8:31
bob1697231-Oct-06 8:31 
GeneralRe: Help! print issue Pin
bob1697231-Oct-06 10:56
bob1697231-Oct-06 10:56 
GeneralRe: Help! print issue Pin
hongmuer1-Nov-06 15:50
hongmuer1-Nov-06 15:50 
GeneralRe: Help! print issue Pin
hongmuer1-Nov-06 16:30
hongmuer1-Nov-06 16:30 
GeneralRe: Help! print issue Pin
bob1697210-Nov-06 19:26
bob1697210-Nov-06 19:26 
QuestionVC++ MSN Client [modified] Pin
priyank_ldce31-Oct-06 5:40
priyank_ldce31-Oct-06 5:40 
Hi,
I am trying to make MSN client using VC++.NET. I am using socket for this. But I get “WSAETIMEDOUT (10060) Connection timed out ” error when I am connecting to messenger.hotmail.com server at port number 1863. Can I know what is wrong with this code? Thanks in advance. Priyank

WORD version;
	WSADATA wsaData;
	int rVal=0;

	version = MAKEWORD(1,1);
	WSAStartup(version,(LPWSADATA)&wsaData);

	LPHOSTENT hostEntry;

//store information about the server
hostEntry = gethostbyname("messenger.hotmail.com");
	if(!hostEntry)
	{
		::MessageBox(NULL,"Failed gethostbyname()","Test",MB_OK);
		return false;
	}

//create the socket
SOCKET theSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);

	if(theSocket == SOCKET_ERROR)
	{
		::MessageBox(NULL,"Failed socket()","Test",MB_OK);
		return false;
        }

//Fill in the sockaddr_in struct
SOCKADDR_IN serverInfo;
	serverInfo.sin_family = AF_INET;
	serverInfo.sin_port = 1863;
	serverInfo.sin_addr = *((LPIN_ADDR)*hostEntry->h_addr_list);
	rVal=connect(theSocket,(LPSOCKADDR)&serverInfo,sizeof(serverInfo));
	if(rVal==SOCKET_ERROR)
	{
		int errCode = ::WSAGetLastError();
		::MessageBox(NULL,"Failed connect()","Test",MB_OK);
		return false;
	}

	closesocket(theSocket);
	WSACleanup();
	MessageBox(NULL, "Connection was made", "SOCKET", MB_OK);


-- modified at 11:52 Tuesday 31st October, 2006
AnswerRe: VC++ MSN Client Pin
Mark Salsbery31-Oct-06 5:49
Mark Salsbery31-Oct-06 5:49 
GeneralRe: VC++ MSN Client Pin
priyank_ldce31-Oct-06 5:57
priyank_ldce31-Oct-06 5:57 
QuestionMmm n00b question about File I/O Pin
Anthony Mushrow31-Oct-06 5:19
professionalAnthony Mushrow31-Oct-06 5:19 
AnswerRe: Mmm n00b question about File I/O Pin
David Crow31-Oct-06 5:23
David Crow31-Oct-06 5:23 
GeneralRe: Mmm n00b question about File I/O Pin
Anthony Mushrow31-Oct-06 6:31
professionalAnthony Mushrow31-Oct-06 6:31 
AnswerRe: Mmm n00b question about File I/O Pin
toxcct31-Oct-06 5:25
toxcct31-Oct-06 5:25 
QuestionHelp!(something about the pointer) Pin
wanlim081731-Oct-06 5:18
wanlim081731-Oct-06 5:18 
AnswerRe: Help!(something about the pointer) Pin
Anthony Mushrow31-Oct-06 5:22
professionalAnthony Mushrow31-Oct-06 5:22 
AnswerRe: Help!(something about the pointer) [modified] Pin
toxcct31-Oct-06 5:33
toxcct31-Oct-06 5:33 
AnswerRe: Help!(something about the pointer) Pin
David Crow31-Oct-06 5:36
David Crow31-Oct-06 5:36 
Generalconst or not ? Pin
toxcct31-Oct-06 5:41
toxcct31-Oct-06 5:41 
GeneralRe: const or not ? Pin
David Crow31-Oct-06 5:57
David Crow31-Oct-06 5:57 
GeneralRe: const or not ? Pin
toxcct31-Oct-06 5:59
toxcct31-Oct-06 5:59 
QuestionNMAKE error Pin
mmhu31-Oct-06 5:15
mmhu31-Oct-06 5:15 
QuestionRe: NMAKE error Pin
David Crow31-Oct-06 5:40
David Crow31-Oct-06 5:40 
QuestionGet and set file date and time Pin
Wim Engberts31-Oct-06 5:15
Wim Engberts31-Oct-06 5:15 
QuestionRe: Get and set file date and time Pin
David Crow31-Oct-06 5:25
David Crow31-Oct-06 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.