Solved

TPoint to OleVariant

Posted on 2001-08-06
3
559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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
code issue 8 187
tidtcpserver connection lost handle 2 111
Twebbrowser in Fire monkey android scrolling to bottom 1 69
how can i delete one control based on its tagstring ? 6 38
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…

730 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