Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSMTP: all are not working? Pin
includeh1013-Aug-09 15:03
includeh1013-Aug-09 15:03 
AnswerRe: SMTP: all are not working? Pin
zhu_lin13-Aug-09 15:46
zhu_lin13-Aug-09 15:46 
AnswerRe: SMTP: all are not working? Pin
Bacon Ultimate Cheeseburger13-Aug-09 15:48
Bacon Ultimate Cheeseburger13-Aug-09 15:48 
GeneralRe: SMTP: all are not working? Pin
includeh1013-Aug-09 16:08
includeh1013-Aug-09 16:08 
GeneralRe: SMTP: all are not working? Pin
Bacon Ultimate Cheeseburger13-Aug-09 16:22
Bacon Ultimate Cheeseburger13-Aug-09 16:22 
AnswerRe: SMTP: all are not working? [modified] Pin
includeh1013-Aug-09 16:19
includeh1013-Aug-09 16:19 
GeneralRe: SMTP: all are not working? Pin
Bacon Ultimate Cheeseburger13-Aug-09 16:35
Bacon Ultimate Cheeseburger13-Aug-09 16:35 
GeneralRe: SMTP: all are not working? Pin
Bacon Ultimate Cheeseburger13-Aug-09 18:45
Bacon Ultimate Cheeseburger13-Aug-09 18:45 
Disregard my last post about recv()...my meds are making me way too fuzzy Smile | :)


Ok, I was able to compile and run it and everything worked fine after a couple of changes. The first problem is with the CHECK() macro:

#define CHECK(iStatus) \
if(iStatus==SOCKET_ERROR) return 0;\
if(iStatus==0) return 0


DO NOT DO THIS! When this macro is expanded by the preprocessor the send or recv operation passed as iStatus will be executed twice:

if(::send(hSock,sz,strlen(sz),0)==SOCKET_ERROR) return 0;
if(::send(hSock,sz,strlen(sz),0)==0) return 0


Instead you might try something like this (until you get everything fixed):

#define CHECK(iStatus) \
{	\
	int result = iStatus;	\
	if(result==SOCKET_ERROR) return 0;	\
	if(result==0) return 0;	\
}


Every email client I tried did not like the date format included in the message header. The following change should work:

::GetDateFormat(0x409,0,0,T("dd MMM yyyy"),wa,200);


I am a lean mean ground beef machine!!!

QuestionIntercept a WM message into a C++ class Pin
428813-Aug-09 13:10
428813-Aug-09 13:10 
AnswerRe: Intercept a WM message into a C++ class Pin
Baltoro13-Aug-09 14:55
Baltoro13-Aug-09 14:55 
AnswerRe: Intercept a WM message into a C++ class Pin
KarstenK13-Aug-09 21:13
mveKarstenK13-Aug-09 21:13 
GeneralRe: Intercept a WM message into a C++ class Pin
428814-Aug-09 4:49
428814-Aug-09 4:49 
GeneralRe: Intercept a WM message into a C++ class Pin
KarstenK16-Aug-09 20:33
mveKarstenK16-Aug-09 20:33 
GeneralRe: Intercept a WM message into a C++ class Pin
428817-Aug-09 4:49
428817-Aug-09 4:49 
AnswerRe: Intercept a WM message into a C++ class Pin
Bacon Ultimate Cheeseburger14-Aug-09 13:07
Bacon Ultimate Cheeseburger14-Aug-09 13:07 
QuestionCan I control MyApp browser extension button order in "Internet Explorer" default toolbar after installation? Pin
neocoin13-Aug-09 8:16
neocoin13-Aug-09 8:16 
QuestionCalling a COM interface from a worker thread Pin
sashoalm13-Aug-09 6:43
sashoalm13-Aug-09 6:43 
AnswerRe: Calling a COM interface from a worker thread Pin
Stuart Dootson13-Aug-09 6:51
professionalStuart Dootson13-Aug-09 6:51 
GeneralRe: Calling a COM interface from a worker thread Pin
sashoalm13-Aug-09 20:48
sashoalm13-Aug-09 20:48 
GeneralRe: Calling a COM interface from a worker thread Pin
Stuart Dootson13-Aug-09 21:07
professionalStuart Dootson13-Aug-09 21:07 
GeneralRe: Calling a COM interface from a worker thread Pin
Stuart Dootson14-Aug-09 2:08
professionalStuart Dootson14-Aug-09 2:08 
QuestionHow to log visited URLs Pin
televes13-Aug-09 5:51
televes13-Aug-09 5:51 
AnswerRe: How to log visited URLs [modified] Pin
Bacon Ultimate Cheeseburger13-Aug-09 12:12
Bacon Ultimate Cheeseburger13-Aug-09 12:12 
JokeRe: How to log visited URLs Pin
Moak13-Aug-09 13:43
Moak13-Aug-09 13:43 
GeneralRe: How to log visited URLs Pin
televes14-Aug-09 10:51
televes14-Aug-09 10:51 

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.