[DUG] Automation types and blobs
Conor Boyd
Conor.Boyd at trimble.co.nz
Thu Jun 1 08:42:07 NZST 2006
Yes, I can't immediately think why that wouldn't work.
The idea of a streaming framework is to allow streaming of more complex
types, but for your requirements, your suggestion may well be perfectly
adequate.
Obviously will require some more robust structure checking on the server
to check that the OleVariant you're getting is formatted as you need.
Cheers,
C.
________________________________
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
On Behalf Of Phil Middlemiss
The second part of the email is basically, would this work:
If I have an automation object with a IPolygon interface and a method on
that interface called AddPoints such as :
IPolygonInterface = interface(IDispatch)
AddPoints(PointsArray : OleVariant);
end;
where PointsArray is a variant array which contains Single values (X, Y
values on a map) that should work shouldn't it (as long as client knows
they are Singles?
Wouldn't this be achieving the same thing as sending the points to a
stream, converting that stream to a variant array of bytes, and sending
the array as an OleVariant?
Phil.
Conor Boyd wrote:
In theory it would work with a VB client etc, but on the
understanding
that the VB code that does the unstreaming would need to know
intimately
the structure of the byte arrays being passed.
I suppose we're lucky in that our client and server are both
Delphi, so
we just compile the streaming classes into both projects and it
just
works.
The other thing to point out about streaming using byte arrays
is that
it's not version-safe (e.g. you change the format of your
internal byte
arrays being streamed and every client will need to know about
it).
We're safe because our server and clients are always in sync,
but it's
something to be aware of.
Not sure I understand the second part of your email, but that
may just
be me being stupid.
C.
-----Original Message-----
From: delphi-bounces at ns3.123.co.nz
[mailto:delphi-bounces at ns3.123.co.nz]
On Behalf Of Phil Middlemiss
I didn't realise variant arrays were automation compatible - the
help
doesn't indicate this. Would this work for a VB or C++ client
app?
I'm wondering if I can shortcut the whole thing though - I have
an
automation interface that represents, say, a polygon. Since the
client
code still has to formulate a variant array (to pass to the
TStreamable), why not just pass the variant array to the polygon
interface?
eg, IMyPolygon.AddPoints(Points : OleVariant);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060601/e03733f5/attachment-0001.html
More information about the Delphi
mailing list