[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 587
  • Last Modified:

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
0
rwv
Asked:
rwv
1 Solution
 
EpsylonCommented:
Could it be a pointer to a 'Point'?
0
 
rondiCommented:
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
 
rwvAuthor Commented:
Found that simply using
 ActiveDocument.getEntityFromPOINT(VarArrayOf(100, 200));
works just fine.

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now