本文整理汇总了C++中CInternet::GetDownloadFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CInternet::GetDownloadFile方法的具体用法?C++ CInternet::GetDownloadFile怎么用?C++ CInternet::GetDownloadFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInternet
的用法示例。
在下文中一共展示了CInternet::GetDownloadFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadMem
int ReadMem(kMemory* pk_Mem, void* buffer, UINT count)
{
if (mu32_BlockSize > 0) // read from the blocks in memory (Cache)
{
// Cabinet.dll opens two handles to the CAB file
// The data in the first block of the CAB file is read multiple times by BOTH handles
if (pk_Mem->s32_Pos + count < mu32_BlockSize)
return mi_FirstBlock.ReadData(buffer, pk_Mem->s32_Pos, count);
// One CAB file handle reads the CAB index (filenames)
// The other handle reads the compressed data
// To avoid unneccessary downloads each CAB file handle has its own cache
DWORD u32_Cache = (DWORD)(INT_PTR) pk_Mem->p_Addr;
return mi_Cache[u32_Cache].ReadData(buffer, pk_Mem->s32_Pos, count);
}
else // read from the downloaded file on disk
{
SetFilePointer(mi_Internet.GetDownloadFile(), pk_Mem->s32_Pos, 0, FILE_BEGIN);
DWORD u32_Read;
if (!ReadFile(mi_Internet.GetDownloadFile(), buffer, count, &u32_Read, 0))
{
mi_Error.Set(FDIERROR_READ_CABFILE, GetLastError(),0);
return -1;
}
return u32_Read;
}
}