|
帮我看看下面的代码,为什么我在win32下可以下载,但wince下handle2为null,wince下参数该怎么设置阿
void download(const char *Url)
{
HINTERNET hSession = InternetOpen("RookIE/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (hSession != NULL)
{
HINTERNET handle2 = InternetOpenUrl(hSession, Url, NULL, 0, INTERNET_FLAG_DONT_CACHE, 0);
if (handle2 != NULL) 《====这一部就为null了,有谁知道wince该怎么设置
{
printf("%s\n",Url);
byte Temp[MAXBLOCKSIZE];
ULONG Number = 1;
FILE *stream;
if( (stream = fopen( "c:\\appa.jpg", "wb" )) != NULL )//这里只是个测试,因此写了个死的文件路径
{
while (Number > 0)
{
InternetReadFile(handle2, Temp, MAXBLOCKSIZE - 1, &Number);
//fprintf(stream, (const char*)Temp);
fwrite(Temp, sizeof (char), Number , stream);
}
fclose( stream );
}
InternetCloseHandle(handle2);
handle2 = NULL;
}
InternetCloseHandle(hSession);
hSession = NULL;
} |
|