TPoint to OleVariant

How do i convert a point to an ole variant?

I'm using an ocx control which has a method
ActiveDocument.getEntityFromPOINT(Point : OleVariant)

thanks
bobby
rwvAsked:
Who is Participating?
 
rondiConnect With a Mentor Commented:
Try creating a variant array of bytes using VarArrayCreate,
then move the memory occupied by a variable of type TPoint
into the variant array.

var
  v: variant;   //or OleVariant ?
  pv: pointer;
  pnt: TPoint;
begin
  v := VarArrayCreate([0,SizeOf(TPoint)-1]....
  pv := VarArrayLock(v);
  pnt.x := 100;
  pnt.y := 200;
  Move(pnt,pv^,SizeOf(TPoint));
  VarArrayUnlock(v);
  ActiveDocument.getEntityFromPOINT(v);
end;
0
 
EpsylonCommented:
Could it be a pointer to a 'Point'?
0
 
rwvAuthor Commented:
Found that simply using
 ActiveDocument.getEntityFromPOINT(VarArrayOf(100, 200));
works just fine.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.