Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Sep 2005
    Posts
    87

    Newbie Question: using ActiveX in AMS 7.5

    Hi,

    I have an ActiveX control that does CAD drawing. Can AMS 7.5 create a container and call, via scripting, the ActiveX functions (like draw, print, etc.)?

    I am trying to figure out if I can embed the ActiveX into an AMS 7.5 app so that it can be used as a drawing feature.

    Any help clarifying this, lead to how it could be done, would be much appreciated.

    Kind Regards,

    SGW

  2. #2
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    I reckon you could use System.RegisterActiveX and the Luacom Plugin which is avaliable here.

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    If it is a visual control, which I assume it is, then no you can't. The only way would be to create an object plugin that wraps the activex control. That's no easy task and depending on how complex the control is it may not even be possible.
    Dermot

    I am so out of here

  4. #4
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    I have found one or two activex controls that I have been able to embed in an AMS listbox and then use LuaCom to control them. The control has to have a parent hwnd property that you can set, which is very rare.
    Dermot

    I am so out of here

  5. #5
    Join Date
    Sep 2005
    Posts
    87
    Hi Dermot and ShadowUK,

    Thanks for your suggestions. I've downloaded the plugin and it's PDF to see if I can figure it out.

    It does appear that there is a hwnd available, so this may not be a problem.

    The big challenge for me as an AMS beginner is whether I can figure out the scripting to successfully call functions in the ActiveX. The language that the ActiveX function calls is written in is C++, so getting these into LUA syntax will be a steep learning curve.

    Kind Regards,

    SGW

  6. #6
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by SGW View Post
    Hi Dermot and ShadowUK,

    Thanks for your suggestions. I've downloaded the plugin and it's PDF to see if I can figure it out.

    It does appear that there is a hwnd available, so this may not be a problem.

    The big challenge for me as an AMS beginner is whether I can figure out the scripting to successfully call functions in the ActiveX. The language that the ActiveX function calls is written in is C++, so getting these into LUA syntax will be a steep learning curve.

    Kind Regards,

    SGW
    If you know C++ you should take a look at the IndigoRose Product SDK. Maybe you could make it an object plugin.

  7. #7
    Join Date
    Sep 2005
    Posts
    87
    Hi ShadowUK,

    I wish I knew C++. Unfortunately, all I was saying is that the ActiveX developer has written their help guide examples for function calls in C++.

    Kind Regards,

    SGW

  8. #8
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by SGW View Post
    Hi ShadowUK,

    I wish I knew C++. Unfortunately, all I was saying is that the ActiveX developer has written their help guide examples for function calls in C++.

    Kind Regards,

    SGW
    I wish I knew it too. :(

  9. #9
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    You don't need to know C++ to use an activex control with LuaCOM. Can you point me to a trial version of this control? I can generate a html file listing all the functions and properties and how to use them with LuaCOM.
    Dermot

    I am so out of here

  10. #10
    Join Date
    Sep 2005
    Posts
    87
    Hi Dermot,

    Here's a link to a fully working, though unlicensed version, with complete help guide materials:

    http://www.kolbasoft.com/vecad6.zip

    The first challenge I would face is loading the ActiveX into an AMS project so that its basic drawing canvas would display in runtime.

    Second challenge would be to figure out the function call to register the code that the developer sent to me, so that the "Unregistered Version" display no longer shows in the canvas window when running. The C++ guidelines to register this registration code and remove the unregistered display are in the help guide chm when searched for the word: "register."

    Any help getting this started would provide a lot of learning, LUA scripting examples for function call and be much appreciated.

    Kind Regards,

    SGW

  11. #11
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Attached is the Lib info which lists all the enumerations and functions. I don't think there is anyway to embed it in AMS though. You can access the functions using LuaCom, but it is not much use when you can't see anything.

    This will display the about box.
    Code:
    vecad = luacom.CreateObject("VeCAD.Ctrl.1")
    
    if vecad then
    	vecad:AboutBox()
    else
    	Dialog.Message("Failed", "Could not create object")
    end
    Last edited by Dermot; 11-14-2009 at 09:33 PM.
    Dermot

    I am so out of here

  12. #12
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    You can register it like this.
    Code:
    vecad = luacom.CreateObject("VeCAD.Ctrl.1")
    
    if vecad then
    	result = vecad:Registration(Your reg code)
            if result then
                --Registered
            else
                -- not registered
            end
    else
    	Dialog.Message("Failed", "Could not create object")
    end
    Dermot

    I am so out of here

  13. #13
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    How did you do that Dermot? Getting the functions and stuff.

    Also, this is not a newbie question. Quite an advanced one at that.

  14. #14
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by ShadowUK View Post
    How did you do that Dermot? Getting the functions and stuff.

    Also, this is not a newbie question. Quite an advanced one at that.
    I used LuaCOM version 1.3. It has a DumpTypeLib function that creates the html file.
    Dermot

    I am so out of here

  15. #15
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Here is an example project using LuaCOM 1.3. It generates the typelib info for the VeCAD control but you can change it to any control you want.
    Last edited by Dermot; 11-14-2009 at 09:33 PM.
    Dermot

    I am so out of here

Similar Threads

  1. question for slideshow in ams 7...
    By autoplmst6 in forum AutoPlay Media Studio 7.5
    Replies: 1
    Last Post: 09-12-2008, 07:49 AM
  2. Newbie Question - Shortcuts To QuickLaunch
    By Major_Moe in forum AutoPlay Media Studio 4.0
    Replies: 10
    Last Post: 09-06-2003, 04:47 PM
  3. INFO: Troubleshooting ActiveX Control Installation
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-03-2002, 10:19 AM
  4. HOWTO: Register an ActiveX Control
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-27-2002, 02:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts