Solved

TPoint to OleVariant

Posted on 2001-08-06
3
555 Views
Last Modified: 2008-03-03
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
Comment
Question by:rwv
3 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6357358
Could it be a pointer to a 'Point'?
0
 
LVL 3

Accepted Solution

by:
rondi earned 200 total points
ID: 6364426
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
 

Author Comment

by:rwv
ID: 6381561
Found that simply using
 ActiveDocument.getEntityFromPOINT(VarArrayOf(100, 200));
works just fine.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now