CString url = L"http://www.wallaceshushu.com"; //
just
for test
CString sCookies = L"CWSID=test; expires=Tue, 03 Dec 2019
18:08:20
GMT;";
DWORD rs=0;
if(!InternetSetCookieEx
(url,NULL,sCookies,INTERNET_COOKIE_THIRD_PARTY,rs))
{
return;
}
DWORD size=0;
::SetLastError(0);
InternetGetCookie(url, NULL, NULL, &size);
HRESULT ret = ::GetLastError();
if (size<=0)
{
return;
}
TCHAR* buf=new TCHAR[size];
if (!InternetGetCookie(url, NULL, buf ,&size))
{
delete[] buf;
return;
}
I built this project in VS2005 with CE6 SDK, the same code run in
Window Mobile 5 and Mobile 6 is ok, but in CE6 it doesn't work(I
have
try many devices which system is CE6 and emulator). I had found the
cookie in \Windows\Profiles\guest\Cookies\, but while calling
InternetGetCookie, the result is false and the variable named size is
0, I try to get the last error but the return value is S_OK.
I don't know why? Is CE6 system bug?
Check the Internet Explorer settings (unlikely to be a problem, but you're
running a different version of Windows CE than either Windows Mobile 5 or 6,
so many things may have changed; the browser is also completely different
than in WM5 at least, not sure about 6). Some setting might be preventing
you from seeing the cookie.
Try allocating, say, double the buffer size returned by the GetCookie call
and passing that larger size to the second call.
Always check the result of GetLastError() when things fail.
Paul T.
"2755...@qq.com" wrote:
> .
>
Paul T.
"2755...@qq.com" wrote:
> .
>