Click here to Skip to main content
15,909,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to do CoCreateInstance without CLSID Pin
CPallini26-Aug-09 22:18
mveCPallini26-Aug-09 22:18 
AnswerRe: How to do CoCreateInstance without CLSID Pin
deadlyabbas26-Aug-09 22:41
deadlyabbas26-Aug-09 22:41 
GeneralRe: How to do CoCreateInstance without CLSID Pin
CPallini26-Aug-09 23:00
mveCPallini26-Aug-09 23:00 
AnswerRe: How to do CoCreateInstance without CLSID Pin
ThatsAlok28-Aug-09 0:43
ThatsAlok28-Aug-09 0:43 
QuestionHow to prevent runtime errors (Rxxxx) from appearing? Pin
tgc126-Aug-09 21:09
tgc126-Aug-09 21:09 
AnswerRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
Adam Roderick J26-Aug-09 22:13
Adam Roderick J26-Aug-09 22:13 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
tgc126-Aug-09 22:40
tgc126-Aug-09 22:40 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
Adam Roderick J26-Aug-09 22:51
Adam Roderick J26-Aug-09 22:51 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
tgc126-Aug-09 23:04
tgc126-Aug-09 23:04 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
Adam Roderick J26-Aug-09 23:29
Adam Roderick J26-Aug-09 23:29 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
tgc126-Aug-09 23:56
tgc126-Aug-09 23:56 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
Adam Roderick J27-Aug-09 0:18
Adam Roderick J27-Aug-09 0:18 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
tgc127-Aug-09 0:32
tgc127-Aug-09 0:32 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
Adam Roderick J27-Aug-09 1:09
Adam Roderick J27-Aug-09 1:09 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
tgc127-Aug-09 1:34
tgc127-Aug-09 1:34 
GeneralRe: How to prevent runtime errors (Rxxxx) from appearing? Pin
Adam Roderick J30-Aug-09 18:18
Adam Roderick J30-Aug-09 18:18 
QuestionTwo port communication [modified] Pin
raviteja202026-Aug-09 21:07
raviteja202026-Aug-09 21:07 
QuestionRe: Two port communication Pin
Adam Roderick J26-Aug-09 21:15
Adam Roderick J26-Aug-09 21:15 
AnswerRe: Two port communication Pin
raviteja202026-Aug-09 22:15
raviteja202026-Aug-09 22:15 
GeneralRe: Two port communication Pin
Adam Roderick J26-Aug-09 22:24
Adam Roderick J26-Aug-09 22:24 
AnswerRe: Two port communication Pin
Rajesh R Subramanian26-Aug-09 21:21
professionalRajesh R Subramanian26-Aug-09 21:21 
GeneralRe: Two port communication Pin
raviteja202026-Aug-09 22:22
raviteja202026-Aug-09 22:22 
QuestionRe: Two port communication Pin
David Crow27-Aug-09 3:09
David Crow27-Aug-09 3:09 
AnswerRe: Two port communication Pin
ThatsAlok28-Aug-09 0:48
ThatsAlok28-Aug-09 0:48 
QuestionSubmit a web form: What I'm doing wrong? [modified] Pin
msn9226-Aug-09 20:56
msn9226-Aug-09 20:56 
Hi everybody.

I want to submit a web form. Source of html page:
<html>
<body>

<form action="i.php" method="post">
Name: <input type="text" name="fname" value="MyName" />
Age: <input type="text" name="age" value="17" />
<input type="submit" />
</form>

</body>
</html>

If I submit the form in the page above, I would get:
Welcome MyName!
You are 17 years old. 


And this is my code:
CInternetSession session(L"MyAgent");
CHttpConnection* httpcon=session.GetHttpConnection(L"localhost");
CHttpFile* httpfile=httpcon->OpenRequest(CHttpConnection::HTTP_VERB_POST,L"i.php");
CString headers=L"Content-Type: application/x-www-form-urlencoded";
CString data=L"fname=MyName&age=17";
httpfile->SendRequest(headers,(LPVOID)(LPCTSTR)data,data.GetLength());
CString t=L"";
UINT len=100;
char buf[100];
while(len>0){
	len=httpfile->Read(buf,100);
	if(len>0)t.Append(CString(buf),len);
}
AfxMessageBox(t);
httpfile->Close();
httpcon->Close();
session.Close();


Unfortunately, form is not being submitted. What I'm doing wrong?

I'm trying to do this thing 3rd time now, I don't want to give up this time Big Grin | :-D

Any help would be greatly appreciated.

modified on Thursday, August 27, 2009 6:28 PM

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.