 |
|
 |
Read your code again...,the first example...thx.
I am not a genius, but shed more sweat!
|
|
|
|
 |
|
|
 |
|
 |
I have gotten alot of use from this class in the past. But in trying to recompile on Visual Studio 2005, I've run into this problem:
typedef struct __GENERIC_HTTP_ARGUMENT{ // ARGUMENTS STRUCTURE
TCHAR szName[__SIZE_HTTP_ARGUMENT_NAME];
TCHAR szValue[__SIZE_HTTP_ARGUMENT_VALUE];
DWORD dwType;
operator==(const __GENERIC_HTTP_ARGUMENT &argV){
return !_tcscmp(szName, argV.szName) && !_tcscmp(szValue, argV.szValue);
}
} GenericHTTPArgument;
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
This occurs at the line beginning with 'operator'. I do not know how to fix it. Can anyone help?
|
|
|
|
 |
|
 |
Never mind. I found the answer in the posts below. Sorry.
BOOL operator==(const __GENERIC_HTTP_ARGUMENT &argV){
|
|
|
|
 |
|
 |
I have a problem with this class.
When using this source on Debug mode, it works propertly.
But when using it on Release mode, it returns any problem.
when I call "RequestOfURI", my app. failed.
Is there any one who know why?
|
|
|
|
 |
|
 |
to fat debugs (better in function)
|
|
|
|
 |
|
 |
Hi,I Had Saw your sample code,then I Create a Win32 console application.
code:
HINTERNET hInternet = InternetOpen(_T("MyInet"), INTERNET_OPEN_TYPE_PRECONFIG, _T(""), _T(""), 0);
HINTERNET hConn = InternetConnect(hConn, _T("localhost"),INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
const TCHAR *szAcceptType[] = __HTTP_ACCEPT_TYPE;
HINTERNET hRequest= HttpOpenRequest(hConn, _T("GET"),_T("/default.htm"), HTTP_VERSION,NULL, szAcceptType, INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_CACHE_WRITE , 0);
DWORD dwError = GetLastError();
dwError always return 122;
Please help me !
Email:caoxin.wh@gmail.com
Regard
|
|
|
|
 |
|
 |
c:\Documents and Settings\Guaz Wei Kiat\My Documents\testing\testing\GenericHTTPClient.cpp(888): fatal error C1010: unexpected end of file while looking for precompiled header directive
|
|
|
|
 |
|
 |
Hi Yongseon,
Well written class! Thanks for the same!
You've not added any methods to add custom headers to be sent to websites. Any suggestions how I can handle the same, extend your class to allow the same? (Sorry - I'm new to WinINET - so any 'pointers' will help me follow the right direction.)
Also, if you have an updated version of your class, can you please direct me to it?
Thanks again,
Nirav Doshi
* Blood donation is the superior'est form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
|
|
|
|
 |
|
 |
Nevermind. I am not now using an alternative mechanism to add the headers.
Thanks anyway!
* Blood donation is the superior'est form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
modified on Sunday, January 18, 2009 11:34 PM
|
|
|
|
 |
|
 |
Hi,
I have same issue trying to figure out how to add or modify the http headers. can you tell me how you resolved this.
Thanks
|
|
|
|
 |
|
 |
Hello,
I'm having a problem when reading response in form of binary data. The problem is that it has some zero bytes, which means that the InternetReadFile function is probably getting the data as a string and interpretating the zero bytes as EOF characters, which means i don't get the entire binary stream, but only the chunk until the first zero byte.
Any solutions?
Thanks.
|
|
|
|
 |
|
 |
Facing problem of uploading file with size 3MB or greater than 3Mb
shrikantssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
|
|
|
|
 |
|
 |
Does the library support https/ssl encryption and mutually authenticated ssl?
|
|
|
|
 |
|
 |
viud W3Client::Close()
if (_hRequest)
::InternetCloseHandle(_hRequest);
1
|
|
|
|
 |
|
 |
The class works beautifully, as far as I can tell. But I have been encountering intermittent failure to detect an Internet connection using the GenericHTTPClient::CheckConnectionExists() function. This seems to happen more often on WinXP Pro with a dialup connection than it does on Win2K with a T1 network line connection. Any idea on how to fix this problem?
|
|
|
|
 |
|
 |
Respected,
myself "Shrikant".
I am using your sample code Please give the Information about folloing fileds.
Q.1 what about folling constant
1. __TAG_USRID etc.
Q.2 what about bCharge veriable , can't understatnd.
Q.3 Please explain thes following parameter.
1. szUserID 2. szSocialIndex 3.szSource 4.szDestination 5.szFormat 6.szMessage 7.szCPCode
8.szFile
Q.4 what about (__TAG_CHARGE,"Y"/"N");
Code:
GenericHTTPClient *pClient=new GenericHTTPClient();
pClient->InitilizePostArguments();
pClient->AddPostArguments(__TAG_USRID, szUserID);
pClient->AddPostArguments(__TAG_JUMIN, szSocialIndex);
pClient->AddPostArguments(__TAG_SRC, szSource);
pClient->AddPostArguments(__TAG_DST, szDestination);
pClient->AddPostArguments(__TAG_FORMAT, szFormat);
pClient->AddPostArguments(__TAG_SUBJECT, szMessage);
if(bCharge){
pClient->AddPostArguments(__TAG_CHARGE, "Y");
}else{
pClient->AddPostArguments(__TAG_CHARGE, "N");
}
pClient->AddPostArguments(__TAG_CPCODE, szCPCode);
pClient->AddPostArguments(__TAG_FILE, szFile, TRUE);
if(pClient->Request(szURL,
GenericHTTPClient::RequestPostMethodMultiPartsFormData)){
LPCTSTR szResult=pClient->QueryHTTPResponse();
}else{
}
Thakns.
Waitng for Reply.
shrikantssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
|
|
|
|
 |
|
|
 |
|
 |
BOOL Response(PBYTE pHeaderBuffer, DWORD dwHeaderBufferLength, PBYTE pBuffer, DWORD dwBufferLength, DWORD &dwResultSize);
pHeaderBuffer contain 0x00? why?
|
|
|
|
 |
|
 |
POST /ev/123.dwr HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://www.cinkoo.cn/
Content-Type: text/plain
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Host: www.cinkoo.cn
Content-Length: 586
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=2657E97838817C28EB7F645DD362E49A
callCount=1
c0-e2=string:16096
c0-param4=string:212
c0-param5=boolean:false
batchId=0
-----------------------------------------
how to send this data?
if you know ,please tell me,thank you.
My MSN:shellhy_cn99@hotmail.com
|
|
|
|
 |
|
 |
hi,
can you tell me how to get the number of bytes sent and received?
this would be fine of you
thanks a lot
|
|
|
|
 |
|
 |
indusi rulyat!!!!
#ifdef _DEBUG
LPVOID lpMsgBuffer;
DWORD dwRet=FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
::GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
reinterpret_cast(&lpMsgBuffer),
0,
NULL);
OutputDebugString(reinterpret_cast(lpMsgBuffer));
LocalFree(lpMsgBuffer);
#endif
this is a 50# of all code !!
do you know about inline functions or a macros ?
idiot
|
|
|
|
 |
|
 |
Hey man,
Calm down. You have to thank to him firt. He posted this resource to help the others. If it is not to you, just skip to others you think useful. Instead of being skeptical and stopping him from helping others, why don't you write your codes and post them to help others?
|
|
|
|
 |
|
 |
Hi, I user your source in my MFC application project of VS2005.
When the debug mode run to the function "BOOL GenericHTTPClient::RequestGet(LPCTSTR szURI)"
BOOL GenericHTTPClient::RequestGet(LPCTSTR szURI){
CONST TCHAR *szAcceptType=__HTTP_ACCEPT_TYPE;
_hHTTPRequest=::HttpOpenRequest(_hHTTPConnection,
__HTTP_VERB_GET, // HTTP Verb
szURI, // Object Name
HTTP_VERSION, // Version
L"", // Reference
&szAcceptType, // Accept Type
INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_CACHE_WRITE,
0); // context call-back point
..........
VS2005 show a dialog to me "Unhandled exception 0x7c84b273 in myPorject.exe: 0xC0000005: Access
voilation reading location 0xcccccccc. Please help me how to reslove this issue. Many ths. your suggestion.
Email: juhtzyy@yahoo.com.tw
|
|
|
|
 |
|
 |
I have had the same problem, although it does not appear to interfere with the performance of the class, just worrisome and annoying.
Did you ever get any answer to this question ?
Mike Pliam
|
|
|
|
 |