Solved

TPoint to OleVariant

Posted on 2001-08-06
3
558 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SUM 2 INTEGER ARRAYS INTO 1 10 108
How to convert memory stream to PDF file 6 108
Wincontrol not (correctly) drawn 15 40
shape, triangle, dbctrlgrid 3 17
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 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