newby - translating from delphi. Converting OleVariant to TVariantInParam

Hi,
Im trying to translate some com code to builder.
The function Im attempting to call is defined as follows

  virtual HRESULT STDMETHODCALLTYPE Write
(TVariant* pvUniqueId/*[in,out]*/, long nCategory/*[in]*/,
  Pdstandardlib_tlb::ERecordAttributes eAttributes/*[in]*/,
  TVariantInParam vData/*[in]*/) = 0;

I'm stuck on the vData field.
In my direct translation up to attempting to call this function  my code
reads as follows (pretty much what I did in Delphi)

  OleVariant TheRec;
  TheRec = VarArrayCreate(Bounds, 1, varByte);
  other code
  if (TheRec. ArrayHighBound(1) != BuffStart)
                        TheRec.ArrayRedim(BuffStart);
  code to fill array with data .......
  RecordAdapter->Write(&VarUnique,  0,  0,  TheRec);

The compiler is reporting an error with the TheRec field in the final line.
Ive looked up TVariantInParam in the help file and I dont understand what I
have to do - I've a very basic understanding of c++ and dont understand
templates etc yet.
If I change the var type to Tvariantinparam, the VarArrayCreate compiles but
ArrayRedim doesnt.

How do I declare and use the TheRec variable please

--
Claire Humphrey
Software Engineer