Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

call InternetGetCookie in CE6 cannot get the cookie.

3 views
Skip to first unread message

2755...@qq.com

unread,
Dec 4, 2009, 2:14:50 AM12/4/09
to
I tried to call InternetGetCookie in CE6 to get the cookie but fail.
Following is my code,

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?

0 new messages