Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: need an ActiveX wrapper that provides basic types for returns
Started by JoeBussell at 07-01-2008 19:31. Topic has 5 replies.

Print Search « Previous Thread Next Thread »
  07-01-2008, 19:31
JoeBussell is not online. Last active: 8/26/2008 11:33:06 PM JoeBussell

Top 50 Posts
Joined on 06-17-2008
Eugene, OR
Posts 31
need an ActiveX wrapper that provides basic types for returns
Reply Quote
I have been attempting to wrap the 14.5 ocx around another ocx file to provide the functionality that I need.  Specifically, I am using a broken language that only allows basic singleton types to be returned.  Variant is strictly out.  The specific call that I need is to get an annotation's points.   To that end I am trying to add a set of functions:

Function getNumPoints() As Long   ` returns the number of points in an annotation, 2 for a line
Function getNthPointX( n As Long ) As Long   ' returns the x axis of the nth point
Function getNthPointY( n As Long ) As Long   ' returns the y axis of the nth point

I am hoping that this interface is already available, or that I can get some help in wrapping the ocx control.  Wrapping simple combinations of basic controls is easy.  The Lead interface has lots of mouse events and write only properties that have to be worked out correctly.

I am getting lost on issues related to the mouse move and down events.  My control is getting the wrong ones specifically.  In one case I am getting the mouse up event when I am doing a mouse move.

Thanks in advance :-)

   Report 
  07-02-2008, 8:36
Adnan Ismail is not online. Last active: 8/14/2008 1:40:07 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,124
Re: need an ActiveX wrapper that provides basic types for returns
Reply Quote
I'm afraid we haven't done this before. The LEAD Main OCX itself is a wrapper around our DLL API functions.

Please note that the LEADTOOLS license agreement prohibits building programming tools to be used anywhere other than your end-user application for which the toolkit was purchased.
Also, if this OCX is going to be used by any other programmers, even if they are employed within your own organizations, you will need extra LEADTOOLS programmer seat licenses to do that. If you are in doubt about this, please send a new ticket to sales@leadtools.com
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  07-02-2008, 13:48
JoeBussell is not online. Last active: 8/26/2008 11:33:06 PM JoeBussell

Top 50 Posts
Joined on 06-17-2008
Eugene, OR
Posts 31
Re: need an ActiveX wrapper that provides basic types for returns
Reply Quote
I am not intending to write a programming tool.  I find the implication in your message a bit alarming.  My firm has been a paying customer for another project, and I am using a legitimate development license to explore solutions to a particular programming problem.

What I am trying to do is interface Lead with a crippled programming language to provide a customer with a useful service.  To achieve this I need the library to provide a very basic interface.  The only return types I can process are: int, byte, word, long, dword, float, and double (plus I can memory map some things, but its real ugly).  Things are generally working nicely (events, adding annotations, etc), but I need to have the points from the annotation.  Although having a complete singleton interface would be real cool, I will be content with getting the (x,y) pair out of the lists that I get from AnnGetPointX and AnnGetPointY.

I am hopeful that I can get assistance.  Would Lead be willing to sell me the interface wrapper?  Heck, I'll even write the VB translation code for the bits I need:  (want it in c?)

' still would like to add bounds checking on hObj and the index fields.

Public Function annGetStartY(hObj As Long) As Variant
    Dim annPointY As Variant
    annPointY = LEAD1.AnnGetPointY(hObject)
    annGetStartY = annPointY(0)
End Function

Public Function annGetEndY(hObj As Long) As Double
    Dim annPointY As Variant
    annPointY = LEAD1.AnnGetPointY(hObject)
    annGetEndY = annPointY(1)
End Function

Public Function annGetStartX(hObj As Long) As Double
    Dim annPointX As Variant
    annPointX = LEAD1.AnnGetPointX(hObject)
    annGetStartX = annPointX(0)
End Function

Public Function annGetEndX(hObj As Long) As Double
    Dim annPointX As Variant
    annPointX = LEAD1.AnnGetPointX(hObject)
    annGetEndX = annPointX(1)
End Function

Public Function annGetPointYById(hObj As Long, n As Integer) As Double
    Dim annPointY As Variant
    annPointY = LEAD1.AnnGetPointY(hObject)
    annGetPointYById = annPointY(n)
End Function

Public Function annGetPointXById(hObj As Long, n As Integer) As Double
    Dim annPointX As Variant
    annPointX = LEAD1.AnnGetPointX(hObject)
    annGetPointXById = annPointX(n)
End Function


   Report 
  07-02-2008, 13:56
JoeBussell is not online. Last active: 8/26/2008 11:33:06 PM JoeBussell

Top 50 Posts
Joined on 06-17-2008
Eugene, OR
Posts 31
Re: need an ActiveX wrapper that provides basic types for returns
Reply Quote
Public Function annGetStartY(hObj As Long) As Variant

should be:

Public Function annGetStartY(hObj As Long) As Double

   Report 
  07-02-2008, 20:32
JoeBussell is not online. Last active: 8/26/2008 11:33:06 PM JoeBussell

Top 50 Posts
Joined on 06-17-2008
Eugene, OR
Posts 31
Re: need an ActiveX wrapper that provides basic types for returns
Reply Quote
8-| I managed to get my wrapper to work.

My hObj needed to match the hObject, sadly the VB interpreter let the ocx file be written with that obvious error.

It would be helpful if the documentation included a list of read only and write only properties.

Additionally, for those who need a similar extension of the ActiveX control, be sure to to include the Paint procedure in your forwarded method set :P
   Report 
  07-03-2008, 11:53
Adnan Ismail is not online. Last active: 8/14/2008 1:40:07 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,124
Re: need an ActiveX wrapper that provides basic types for returns
Reply Quote
Joe,
Thank you for sharing the solution with us. Sorry I wasn't much of a help on this one, but these kinds of details are hard to debug without having the source code or a sample project that simulates it. Also, I was not assuming you were in violation of our license agreement. However, we sometimes remind our customers of the restriction on creating programming tools because all our toolkits are sold with this condition, and since this is a public forum, I didn't want other users to think it's OK to create controls using LEADTOOLS without any restrictions.
Adnan Ismail
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » General » Feature Request... » Re: need an ActiveX wrapper that provides basic types for returns

Powered by Community Server, by Telligent Systems