Click here to Skip to main content
15,910,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: $(ProgramFiles) Pin
wangningyu7-May-10 22:44
wangningyu7-May-10 22:44 
GeneralRe: $(ProgramFiles) Pin
Chesnokov Yuriy7-May-10 23:08
professionalChesnokov Yuriy7-May-10 23:08 
GeneralRe: $(ProgramFiles) Pin
David Crow10-May-10 4:24
David Crow10-May-10 4:24 
AnswerRe: $(ProgramFiles) Pin
Richard MacCutchan7-May-10 22:48
mveRichard MacCutchan7-May-10 22:48 
AnswerRe: $(ProgramFiles) Pin
Chesnokov Yuriy7-May-10 23:08
professionalChesnokov Yuriy7-May-10 23:08 
GeneralRe: $(ProgramFiles) Pin
Richard MacCutchan7-May-10 23:30
mveRichard MacCutchan7-May-10 23:30 
AnswerRe: $(ProgramFiles) Pin
Sauce!8-May-10 2:00
Sauce!8-May-10 2:00 
QuestionCString to const unsigned char * Pin
mesajflaviu7-May-10 21:19
mesajflaviu7-May-10 21:19 
AnswerRe: CString to const unsigned char * Pin
wangningyu7-May-10 21:30
wangningyu7-May-10 21:30 
QuestionRe: CString to const unsigned char * [modified] Pin
mesajflaviu7-May-10 23:54
mesajflaviu7-May-10 23:54 
QuestionRe: CString to const unsigned char * Pin
David Crow10-May-10 4:26
David Crow10-May-10 4:26 
AnswerRe: CString to const unsigned char * Pin
wangningyu10-May-10 4:34
wangningyu10-May-10 4:34 
GeneralRe: CString to const unsigned char * Pin
David Crow10-May-10 4:49
David Crow10-May-10 4:49 
AnswerRe: CString to const unsigned char * Pin
Richard MacCutchan8-May-10 1:16
mveRichard MacCutchan8-May-10 1:16 
GeneralRe: CString to const unsigned char * Pin
mesajflaviu8-May-10 2:01
mesajflaviu8-May-10 2:01 
QuestionMFC SDI based project reading virtual serial port: uses worker thread for reading data Pin
harinathcau7-May-10 21:16
harinathcau7-May-10 21:16 
AnswerRe: MFC SDI based project reading virtual serial port: uses worker thread for reading data [modified] Pin
Jonathan Davies8-May-10 2:18
Jonathan Davies8-May-10 2:18 
QuestionSetting up a WindowsAPI project Pin
Tiberiu117-May-10 21:06
Tiberiu117-May-10 21:06 
AnswerRe: Setting up a WindowsAPI project Pin
Software_Developer8-May-10 20:48
Software_Developer8-May-10 20:48 
GeneralRe: Setting up a WindowsAPI project Pin
Tiberiu118-May-10 21:23
Tiberiu118-May-10 21:23 
GeneralRe: in the child window's message pump Pin
Software_Developer9-May-10 8:47
Software_Developer9-May-10 8:47 
QuestionNeed Help : My CHttpFile::SendRequest() , timeouts when sending data to google translator Pin
m_code7-May-10 20:24
m_code7-May-10 20:24 
I want to use google translator aapi through an application I wrote the following code but CHttpFile::SendRequest() method always time out I could n't found what's my problem. Can any one help me?
CString szTranReq(L"/translate_a/t?client=t&sl=en&tl=tr");
	
CString szText(L"text=Hello");

CString szServer(L"www.google.com");

DWORD inetPort = 80;




CInternetSession inetSession(::AfxGetAppName(), 1, PRE_CONFIG_INTERNET_ACCESS, NULL, NULL, NULL);

inetSession.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 1000 * 3);
inetSession.SetOption(INTERNET_OPTION_CONNECT_BACKOFF, 1000);
inetSession.SetOption(INTERNET_OPTION_CONNECT_RETRIES, 1);

CHttpConnection* pInetHttpConnection = inetSession.GetHttpConnection(szServer, inetPort, NULL, NULL); 


CHttpFile* pHttpFile = pInetHttpConnection->OpenRequest(
	CHttpConnection::HTTP_VERB_POST,
	szTranReq, NULL, 1, NULL, NULL,
	INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_DONT_CACHE);



pHttpFile->AddRequestHeaders(L"Host: www.google.com\r\n", HTTP_ADDREQ_FLAG_ADD_IF_NEW);
pHttpFile->AddRequestHeaders(L"User-Agent: Mozilla/5.0\r\n", HTTP_ADDREQ_FLAG_ADD_IF_NEW);
pHttpFile->AddRequestHeaders(L"Accept-Encoding: deflate\r\n", HTTP_ADDREQ_FLAG_ADD_IF_NEW);
pHttpFile->AddRequestHeaders(L"content-length: 10\r\n", HTTP_ADDREQ_FLAG_ADD_IF_NEW);
pHttpFile->AddRequestHeaders(L"Connection: Close\r\n", HTTP_ADDREQ_FLAG_ADD_IF_NEW);

pHttpFile->SendRequest();

SendRequest() Method always timeout.
AnswerRe: Need Help : My CHttpFile::SendRequest() , timeouts when sending data to google translator Pin
Randor 9-May-10 10:22
professional Randor 9-May-10 10:22 
GeneralRe: Need Help : My CHttpFile::SendRequest() , timeouts when sending data to google translator Pin
m_code10-May-10 18:52
m_code10-May-10 18:52 
GeneralRe: Need Help : My CHttpFile::SendRequest() , timeouts when sending data to google translator Pin
Randor 11-May-10 16:40
professional Randor 11-May-10 16:40 

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.