Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralUsing SOAP in vc++ service application Pin
16-Mar-05 2:21
suss16-Mar-05 2:21 
GeneralError regarding C++ DLL Pin
Amarelia16-Mar-05 2:19
Amarelia16-Mar-05 2:19 
GeneralRe: Error regarding C++ DLL Pin
David Crow16-Mar-05 2:54
David Crow16-Mar-05 2:54 
GeneralRe: Error regarding C++ DLL Pin
Amarelia16-Mar-05 17:52
Amarelia16-Mar-05 17:52 
GeneralRe: Error regarding C++ DLL Pin
David Crow17-Mar-05 3:21
David Crow17-Mar-05 3:21 
GeneralRe: Error regarding C++ DLL Pin
Alexander M.,17-Mar-05 6:33
Alexander M.,17-Mar-05 6:33 
GeneralRe: Error regarding C++ DLL Pin
Alexander M.,16-Mar-05 4:15
Alexander M.,16-Mar-05 4:15 
GeneralHttpOpenRequest problem Pin
gecool16-Mar-05 1:44
gecool16-Mar-05 1:44 
Hi everyone. I need some help on this: I am using wininet funcs to "talk" to a http server. I am opening a root handle with InternetOpen (ret code OK), than I call Internetconnect (ret code OK). I am openning then a request handle, with HttpOpenRequest:
	<br />
void CfileURL::OpenRequest()<br />
{<br />
        LPCTSTR lpszVerb = "GET";<br />
	LPCTSTR lpszObjectName = "/avcenter/venc/data/w32.kelvir.c.html";<br />
	LPCTSTR lpszVersion = NULL;			// Use default.<br />
	LPCTSTR lpszReferrer = NULL;		// No referrer.<br />
	LPCTSTR lplpszAcceptTypes =("Accept : */* ""Accept-Ranges: bytes");<br />
	DWORD dwOpenRequestFlags = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP |<br />
		INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |<br />
		INTERNET_FLAG_KEEP_CONNECTION |<br />
		INTERNET_FLAG_NO_AUTH |<br />
		INTERNET_FLAG_NO_AUTO_REDIRECT |<br />
		INTERNET_FLAG_NO_COOKIES |<br />
		INTERNET_FLAG_NO_UI |<br />
		INTERNET_FLAG_RELOAD;<br />
	DWORD dwOpenRequestContext = 0;<br />
<br />
<br />
	m_h_Request = HttpOpenRequest(m_h_URL, lpszVerb, m_URL.object_name, lpszVersion,<br />
		lpszReferrer, (LPCTSTR *) &lplpszAcceptTypes,<br />
		dwOpenRequestFlags, dwOpenRequestContext);<br />
	<br />
//	if (!m_h_Request)<br />
<br />
		DWORD err=GetLastError();<br />
<br />
//*************End HttpOpenRequest****************<br />
	return err;<br />
}<br />

then i make
char ah[] = "Range: bytes=0-30";
bool bResult = HttpAddRequestHeaders(m_h_Request, ah, strlen(ah), HTTP_ADDREQ_FLAG_ADD_IF_NEW);
and then i send the request with HttpSendRequest, to determine if the server accepts bytes range. I get the status code 206 (partial content) (for the server I use) which is ok for me. I close the m_h_Request handle obtain from the previous call to httpopenhandle.

Then I make a new request, to determine the file size:
bool bret = OpenRequest();

bool bResult = HttpSendRequest(m_h_Request, NULL, 0, NULL, 0);
DWORD dwSize = sizeof(DWORD);
DWORD infolevel = HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER;
if (!HttpQueryInfo(m_h_Request, infolevel, &m_dwflen, &dwSize, NULL))
DWORD qi = GetLastError();
then i close the handle m_h_Request (httpopenrequest)
at this point i have determined the file size, which is ok,

BUT
when i try to open a new request with the above function i get ret code 122 which is ERROR_INSUFFICIENT_BUFFER. What i do not understand is why at first two calls OpenRequest returned ok, and now it returns 122.
If anyone can tell me which is the right way to use the httpOpenrequest, handle (should i or i should not close the handle after each request, than open it again for a new request) please do so.

Any help is wellcome.
THANKZ:->
GeneralBitBlt fails under Win98SE Pin
Vinaya16-Mar-05 1:26
Vinaya16-Mar-05 1:26 
GeneralExtra memory for CEdit Pin
Member 160732616-Mar-05 1:11
Member 160732616-Mar-05 1:11 
GeneralRe: Extra memory for CEdit Pin
ThatsAlok16-Mar-05 1:54
ThatsAlok16-Mar-05 1:54 
GeneralRe: Extra memory for CEdit Pin
Member 160732616-Mar-05 2:04
Member 160732616-Mar-05 2:04 
GeneralRe: Extra memory for CEdit Pin
David Crow16-Mar-05 2:56
David Crow16-Mar-05 2:56 
GeneralRe: Extra memory for CEdit Pin
Manfred Staiger16-Mar-05 2:11
Manfred Staiger16-Mar-05 2:11 
GeneralRe: Extra memory for CEdit Pin
Member 160732616-Mar-05 2:15
Member 160732616-Mar-05 2:15 
GeneralRe: Extra memory for CEdit Pin
Manfred Staiger16-Mar-05 2:21
Manfred Staiger16-Mar-05 2:21 
GeneralRe: Extra memory for CEdit Pin
Member 160732616-Mar-05 2:24
Member 160732616-Mar-05 2:24 
GeneralDetecting a desktop switch Pin
Ryan Binns16-Mar-05 0:43
Ryan Binns16-Mar-05 0:43 
General/OPT:REF issues - linker gurus please help Pin
Spiritofamerica16-Mar-05 0:36
Spiritofamerica16-Mar-05 0:36 
GeneralRe: /OPT:REF issues - linker gurus please help Pin
Ryan Binns16-Mar-05 0:45
Ryan Binns16-Mar-05 0:45 
GeneralRe: /OPT:REF issues - linker gurus please help Pin
Anonymous16-Mar-05 21:55
Anonymous16-Mar-05 21:55 
GeneralVC++ Chatting Program Pin
niruban15-Mar-05 23:57
niruban15-Mar-05 23:57 
GeneralRe: VC++ Chatting Program Pin
David Crow16-Mar-05 3:00
David Crow16-Mar-05 3:00 
GeneralDCom Pin
pardis15-Mar-05 20:44
pardis15-Mar-05 20:44 
GeneralRe: DCom Pin
Michael P Butler16-Mar-05 11:17
Michael P Butler16-Mar-05 11:17 

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.