Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting a pointer to a context menu Pin
valikac15-May-04 15:27
valikac15-May-04 15:27 
GeneralRe: Getting a pointer to a context menu Pin
srev16-May-04 7:37
srev16-May-04 7:37 
GeneralMapped Network drive (connect to it) Pin
scott987uk15-May-04 12:35
scott987uk15-May-04 12:35 
GeneralRe: Mapped Network drive (connect to it) Pin
valikac15-May-04 15:28
valikac15-May-04 15:28 
GeneralRe: Mapped Network drive (connect to it) Pin
scott987uk15-May-04 15:32
scott987uk15-May-04 15:32 
Generalalphabetize list box at run time Pin
Selevercin15-May-04 12:05
Selevercin15-May-04 12:05 
GeneralRe: alphabetize list box at run time Pin
valikac15-May-04 15:33
valikac15-May-04 15:33 
GeneralUnable to make a successfull CHttpFile.SendRequest() call Pin
Terry O'Nolley15-May-04 10:38
Terry O'Nolley15-May-04 10:38 
I keep getting an error 500 returned (I do analyze the return value in the actual code - this is simplified). It does not throw an exception - I am reaching the server and if I download the returned page - I get the server-generated error HTML.

Here is my code:
void SomeClass::SomeFunction()
{
CInternetSession session("TheAgent");
CHttpConnection* server = NULL;	
CHttpFile* page;
CString headers;
CString& refheaders=headers; 
DWORD dwRet;
DWORD& refdwRet = dwRet;
	
try
{
   server = session.GetHttpConnection("somewhere.com", (INTERNET_PORT)80); 
   page = server->OpenRequest(CHttpConnection::HTTP_VERB_GET, "http://somewhere.com/index.htm");
   
   headers = "Accept: text/*\r\nUser-Agent: TheAgent\r\n";
   page->AddRequestHeaders(refheaders);
   
   // ERROR CODE IS ALWAYS 500
   page->SendRequest();
   page->QueryInfoStatusCode(refdwRet);
   // ERROR CODE IS ALWAYS 500
		
   if (dwRet == HTTP_STATUS_OK)
      MessageBox("SUCCESS");
   else
      MessageBox("ERROR"); 
		
   delete page;	
   delete server;
}
catch (CInternetException* pEx)
{
   MessageBox("CATCH");
}
	
session.Close();
} // exit function


My server is running fine. I can take the same URL in the OpenRequest() call and paste it into the browser and the page loads just fine.








GeneralRe: Unable to make a successfull CHttpFile.SendRequest() call Pin
Hesham Amin15-May-04 20:33
Hesham Amin15-May-04 20:33 
GeneralRe: Unable to make a successfull CHttpFile.SendRequest() call Pin
Terry O'Nolley16-May-04 5:08
Terry O'Nolley16-May-04 5:08 
GeneralTransfer of Files Pin
shals16915-May-04 9:38
shals16915-May-04 9:38 
GeneralRe: Transfer of Files Pin
toxcct15-May-04 10:23
toxcct15-May-04 10:23 
GeneralRe: Transfer of Files Pin
valikac15-May-04 15:37
valikac15-May-04 15:37 
GeneralConverting C++ project into COM object Pin
Tony Archer15-May-04 9:35
Tony Archer15-May-04 9:35 
GeneralRe: Converting C++ project into COM object Pin
Kamyar Souri15-May-04 21:45
Kamyar Souri15-May-04 21:45 
GeneralADMIN Pin
Renjith Ramachandran15-May-04 6:01
Renjith Ramachandran15-May-04 6:01 
GeneralRe: ADMIN Pin
andi_mihai15-May-04 6:14
andi_mihai15-May-04 6:14 
GeneralLooking for C++ class to parse/read RSS Pin
TigerNinja_15-May-04 4:37
TigerNinja_15-May-04 4:37 
GeneralRe: Looking for C++ class to parse/read RSS Pin
User 665815-May-04 4:48
User 665815-May-04 4:48 
GeneralRe: Looking for C++ class to parse/read RSS Pin
TigerNinja_15-May-04 5:36
TigerNinja_15-May-04 5:36 
GeneralRe: Looking for C++ class to parse/read RSS Pin
Ravi Bhavnani15-May-04 6:15
professionalRavi Bhavnani15-May-04 6:15 
Generalexcel files Pin
andi_mihai15-May-04 4:23
andi_mihai15-May-04 4:23 
GeneralRe: excel files Pin
Renjith Ramachandran15-May-04 5:52
Renjith Ramachandran15-May-04 5:52 
QuestionI2C Bus & DirectX !? Pin
Behzad Ebrahimi15-May-04 2:31
Behzad Ebrahimi15-May-04 2:31 
GeneralSOS !!! Error while printing through PDFWriter Pin
JigneshSuthar15-May-04 2:26
JigneshSuthar15-May-04 2:26 

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.