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?