On 5/10/05, Rob Kennedy <[EMAIL PROTECTED]> wrote:
> It's code that you write and test, or it's code that someone else
> already wrote and tested for you. Either way, it's extra code. (But if
> it's code you need for your program to work, it's hardly "extra.")
I just dont like to validate everything like in the code below, so
what I'm going to do is just to get the ideas and implement my own
TStreamAdapter that doesnt need to be compatible with COM nor have
these validations, I'm just learning how to use interfaces, so
everything I do will be nice for me... It doesnt matter if I'm just
reinventing the wheel or loosing time :)
function TStreamAdapter.Read(pv: Pointer; cb: Longint; pcbRead:
PLongint): HResult;
var
NumRead: Longint;
begin
try
if pv = Nil then
begin
Result := STG_E_INVALIDPOINTER;
Exit;
end;
NumRead := FStream.Read(pv^, cb);
if pcbRead <> Nil then pcbRead^ := NumRead;
Result := S_OK;
except
Result := S_FALSE;
end;
end;
> When there are disk I/O operations involved, I don't think a
> half-dozen-or-so extra CPU instructions per method call is going to make
> much of a difference.
It's true, but I'm just wanting to make things in a nice way =)
--
"ME ALIMENTE [http://br-linux.org/noticias/002750.html] hehe"
"Invente, Tente!!! Fa�a um c�digo eficiente" (Jonas Raoni haha)
Jonas Raoni Soares Silva
---------------------------
Desenvolvedor de aplica��es
jonasraoni at gmail dot com
http://www.joninhas.ath.cx:666
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/