Jon Skeet said:
Odd - I've got the same quote as Nick had in ISequentialStream::Read,
and I'm sure I've been installing all the latest disks... Is there a
decent way of finding the version of any particular file? The URL in
the offline MSDN is
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.WIN32COM.v10.en/oledb/htm/
oledbisequentialstream__read.htm
Hmmm, I see ....
I'm on -
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.WIN32COM.v10.en/stg/stg/isequentialstream_read.htm
-
see, ISTREAM is part of the "structured storage" interfaces, while you are
at the "oledb programmers reference " stuff, it's not surprising to find
this here, it's old hat that never gest updated in the post OLEDB age ;-),
IMO it doesn't even belong there.
Also take note that I did not install from the distribution, but I install
the latest download available from the MSDN subscribers area, more exactly,
the April 2007 MSDN Library (en_msdn_library_2007_04_dvd_X13-63638.iso
ISO-9660 DVD Image ).
My guess is that the docs are wrong/incomplete. I'm surprised at the
difference between the offline and online docs though
Incomplete, I agree, wrong? (take care [1]) possibly, confusing -
certainly....
I think it counts as "wrong" if it's been introduced into the
documentation as if it had always been part of the interface contract,
when older implementations could have legitimately returned the
appropriate error code instead.
Return values are never part of the contract, a COM interface is carved in
stone, right, that means you cannot change the return type nor the argument
types and number of arguments, but the value returned is not part of the
contract
The documentation specifies the "standard" return values, like S_OK, E_FAIL
etc.., but the implementor of an interface method is free to return what he
sees fit.
Now, when you look at the ISequential::Read method, you'll see that
STG_E_INVALIDPOINTER is one of the values that could "possibly" be returned
from a typical implemetation. If the implementor , requires the pointers to
be valid, it can return STG_E_INVALIDPOINTER when one of them is not. I have
found one implementation that actually does that. So IMO, the parameter
description was too general, in the sense that it makes you fell that null
is valid irrespective the implementaton of the interface.
So, again be prepared to get an exception thrown on you when passing null,
note that this is extremely rare to happen, besides, you should never pass a
null pointer, as it's nearly impossible to know what exactly has been
returned from the callee (0 values is valid data to be returned in the
buffer).
..
This is a general complaint of mine, the .NET MSDN docs are produced by
"robots", no longer by humans, they offer not much more than what's
actually
documented in the .NET library code, that is the minimum, programmers are
no
technical writers and having both is a slow and too expensive process,
even
for MSFT , so they expect from us that we add the missing pieces and
possibly correct what's wrong (see the MSDN's Community contents), which
is
not a bad idea after all.
[1] Finally it will be the community's fault the docs are wrong ;-).
Indeed. I'm ashamed to say I haven't found time to contribute to the
MSDN pages, beyond mailing appropriate people when I've spotted
mistakes.
Same here, but I'm not ashamed ;-)
Willy.