HRESULT IStream::Read(void *Buffer, ULONG TailleDemandee, ULONG *TailleLue);
Le nombre d'octets effectivement lus est rangé dans TailleLue.
#include <windows.h>
#include <winbase.h>
#include <ole2.h>
char Buffer[256];
IStream *pIStream;
ULONG TailleLue;
LARGE_INTERGER Deplacement;
ULONG TailleEcrite;
...
TailleLue=0;
if (pIStream->Read(Buffer, 256, &TailleLue)!=S_OK)
{
...
}
...
Deplacement.Quad=0;
if (pIStream->Seek(Deplacement, STREAM_SEEK_SET, &Deplacement)!=S_OK)
{
...
}
...
if (pIStream->Seek(Deplacement, STREAM_SEEK_SET, &Deplacement)!=S_OK)
{
...
}
...
TailleEcrite=0;
if (pIStream->Write(Buffer, 256, &TailleEcrite)!=S_OK)
{
...
}
...