ft,看的不是一个地方。
HRESULT Seek(
LARGE_INTEGER dlibMove, //Offset relative to dwOrigin
DWORD dwOrigin, //Specifies the origin for the offset
ULARGE_INTEGER * plibNewPosition
//Pointer to location containing new seek
// pointer
);
那么,用plibNewPosition也是一样,它是个out参数。
呃,楼上的,seek的返回值
S_OK
The seek pointer has been successfully adjusted.
E_PENDING
Asynchronous Storage only: Part or all of the stream's data is currently unavailable. For more information see IFillLockBytes and Asynchronous Storage.
STG_E_INVALIDPOINTER
The value of the plibNewPosition parameter is not valid.
STG_E_INVALIDFUNCTION
The value of the dwOrigin parameter is not valid.
STG_E_REVERTED
The object has been invalidated by a revert operation above it in the transaction tree.
用seek的回传参数还差不多。
Read
public int Read(byte buf[], int off, int len);
Reads bytes from the stream object into a byte array, starting at a specified offset from the current seek pointer.
Return Value:
Returns the number of bytes actually read.
Parameter Description
buf The buffer that the bytes are read into.
off The offset in the stream to begin reading from.
len The number of bytes to read.
————————————————————————————————————————
IStream * pStream;
long sz = pStream->Seek(0, STREAM_SEEK_END);
byte *buf = new byte[sz];
pStream->Seek(0, STREAM_SEEK_SET);
pStream->Read(buf, 0, sz);
Seek
public long Seek(long dlibMove, int dwOrigin);
Changes the seek pointer to a new location relative to the beginning of the stream, the end of the stream, or the current seek pointer.
Return Value:
Returns the new seek pointer of the stream.
Parameter Description
dlibMove The offset relative to dwOrigin.
dwOrigin The origin of the offset; must be STREAM_SEEK_CUR, STREAM_SEEK_END, or STREAM_SEEK_SET.