Hi Phil

Dennis Chuah commented on this a while ago.
The variable you pass to Params in ProcessData() must be declared as

ParamArray : array of TVarRec;

For each value inside your Variant array, add a new TVarRec to ParamArray.
Then pass the ParamArray to ProcessData().

Todd.

----- Original Message ----- 
From: "Phil Middlemiss" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Friday, August 08, 2003 11:03 AM
Subject: Re: [DUG]: OleVairant array


> Thanks Todd, but I tried that and the the problem isn't so much working
out
> if I've got an array (I know I have at that stage), but how to pass it on
> without having to pull it apart.  The method that receives the data looks
> abit like this:
>
> procedure MyClass.ReceiveData(const Sender: IUnknown; Params: OleVariant);
>
> and I need to send the params (a variant array) to a method declared like
> this:
>
> function OtherClass.ProcessData(const Sender : IUnknown; const Params:
array
> of const);
>
> It's the "array of const" declaration that doesn't seem to have a
> corresponding type that can be passed to it.
> The only way that I can do it is by pulling apart the OleVariant and
passing
> them, as a hard coded array, to the other method. That's no good because
it
> requires knowledge of what elements are in the array before passing them
on.
> I may need to revisit the architecture.
>
> Thanks,
> Phil.
>
> ----- Original Message ----- 
> From: "Todd Martin" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Friday, August 08, 2003 10:21 AM
> Subject: Re: [DUG]: OleVairant array
>
>
> > Hi Phil
> >
> > Assigning the OleVariant to a variable of type "Variant" should convert
it
> > automatically. Then you can just use TVarData to determing if you're
> dealing
> > with an array.
> >
> > Todd.
> >
> > ----- Original Message ----- 
> > From: "Phil Middlemiss" <[EMAIL PROTECTED]>
> > To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> > Sent: Thursday, August 07, 2003 1:07 PM
> > Subject: [DUG]: OleVairant array
> >
> >
> > > I'm attempting to send a Variant array (received as an "Array of
const")
> > > through an OLE server interface as an OleVariant. Two questions:
> > >
> > > 1) Does a variant array convert happily to an OLEVariant?
> > >
> > > 2) If so, how do I cast it back to a variant array at the other end?
> > >
> > > Cheers,
> > > Phil.
> > >
> > >
> >
>
> --------------------------------------------------------------------------
> > -
> > >     New Zealand Delphi Users group - Delphi List -
[EMAIL PROTECTED]
> > >                   Website: http://www.delphi.org.nz
> > > To UnSub, send email to: [EMAIL PROTECTED]
> > > with body of "unsubscribe delphi"
> > > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> > >
> >
> >
>
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> >
>
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to