Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420

    Calling ActiveX dll's from AMS

    Would it be possible to create a C++ wrapper for an activeX dll so that it could be used in AMS?

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Why would you do that when you can just use LuaCOM to work with the ActiveX dll.
    Dermot

    I am so out of here

  3. #3
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    Ive never really looked into using LUA, ive been avoiding learning any more high level languages as I've just started studying vc++.If its just a case of adding a few lines of code to an AMS project then it might be worth looking into. Do you have any links to some sample code?

    Ive been toying with the idea of making a tool that could take an ordinary ActiveX.dll and then with some user input,automaticly build the code for a C++ wrapper so the functions would be accessable from any language. I know something similar has been done for languages like PowerBasic http://winch.pinkbile.com/wiki/index.php/Main/Dlltool

    I was supprised to learn the VisualBasic6 CAN make standard windows Dll's after all. It just takes a bit of messing about with the way it compiles. http://www.vb-helper.com/howto_make_standard_dll.html
    http://www.windowsdevcenter.com/pub/...reate_dll.html
    Last edited by clueless; 06-14-2008 at 10:44 AM.

  4. #4
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    I was supprised to learn the VisualBasic6 CAN make standard windows Dll's after all. It just takes a bit of messing about with the way it compiles. http://www.vb-helper.com/howto_make_standard_dll.html
    http://www.windowsdevcenter.com/pub/...reate_dll.html
    Has anyone else tried this at all? I had a go last night but couldnt make the dll work with AMS.
    Theres a few software addons for visual basic6 that claim to be able to expose the functions to create a standard windows dll as well. It would be great to be able to do this without having to go into VC++

  5. #5
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    ..lol. Not getting a lot of intrest in this subject. What im trying to do is convert my dynamic masking tool for AMS into a dll (Ill still be giving it away free). Im slowly learning c++ so eventually ill be able to do this the correct way. Ive made it into an activeX dll without to much stress.

    What i need to know is ..could this VB6 solution work with AMS... in theory?

    Will this realy produce a real dll or is it some dodgy workaround thats never going to run correctly if called from AMS?
    Last edited by clueless; 06-20-2008 at 03:04 PM.

  6. #6
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by clueless View Post
    Has anyone else tried this at all? I had a go last night but couldnt make the dll work with AMS.
    Theres a few software addons for visual basic6 that claim to be able to expose the functions to create a standard windows dll as well. It would be great to be able to do this without having to go into VC++
    Yes I have tested this and it worked perfectly. The attached apz has a simple dll and an activex dll I created using that technic. I no longer have the VB source though. It is definetly an easy way to create dlls.
    Last edited by Dermot; 11-14-2009 at 09:33 PM.
    Dermot

    I am so out of here

  7. #7
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    ... Thanks. Looks like im going to be busy all weekend

  8. #8
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    I found a small patch for VB6 that takes care of the renaming of the linker etc..

    It comes with sample code to
    Attached Files

  9. #9
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by clueless View Post
    I found a small patch for VB6 that takes care of the renaming of the linker etc..

    It comes with sample code to
    Nice! That makes it much easier.
    Dermot

    I am so out of here

  10. #10
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    I finaly managed to do this to

    Ill see if i can get my dynamic masking tool done next .
    Attached Files

  11. #11
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    Hmm.. this is a bit more complex than i had anticipated.

    The code for the dll has to but put into a .bas module, if i use forms within the dll code the dll just crashes. But the image manipulation functions Ive made all require a bitmap to be displayed in a standard picture object before i can point a safearray to its structure to gain a valid reference to be able to edit its pixels quickly.

    I know bitmaps can be referenced without first displaying them because Ive done it a few times by mistake while working out how safe arrays worked.

    I might just press on and work out how to do this the correct way in MFC .lol
    Last edited by clueless; 06-23-2008 at 08:34 AM.

  12. #12
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    Ive finnaly discovered how this can be done;
    VB6 programs at runtime make significant use of COM interfaces, even if the source
    code does not use COM objects explicitly. Some critical runtime support mechanisms,
    including error handling, are COM-based (eg. the Err object). VB6 applications
    (EXE’s) automatically initialise their COM environment when executed, but VB6 DLL’s
    only initialise COM when the client application uses the DLL via a COM interface, not
    as an API (a shared library).
    If a client application calls a VB6 DLL function directly, the DLL’s runtime state has no
    COM capability, and so the DLL will abort if it makes any sort of COM object
    reference. This has fatal consequences for the entire client process.
    But it does seem that there is a way to handle the COM instantiation correctly so you can use VB normally Solution .

  13. #13
    Join Date
    May 2006
    Posts
    5,380
    altho this is very useful info, it takes away the power and flexabilty to make a static dll for AMS as its single threaded dll calls, i like working with ocx files now more than dll files

    if we had some more dll actions then yeah, it would be great
    Code:
    DLL.Open("myfile.dll")
    DLL.CallFunction("Function",arg0,arg1,arg2)
    DLL.Close()
    then at least we could open the dll in memory and work with it that way
    Open your eyes to Narcissism, Don't let her destroy your life!!

  14. #14
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    altho this is very useful info, it takes away the power and flexabilty to make a static dll for AMS as its single threaded dll calls
    Could you elaborate?

  15. #15
    Join Date
    May 2006
    Posts
    5,380
    AMS calls a dll and waits for its return, the app waits, nothing happens till the dll has finished its job

    with an activex dll you can call the function and the app can carry on working and you can recive events from the activex while its working before the function returns

    i only see this method as being any good for making a dll for pure basic or any other dev tool that can *open* a dll and work with it that way

    the key is communication, something that lacks with AMS dll calls and for a dynamic masking tool i would want some communication between the app and the dll

    but, everyone has there own view
    Open your eyes to Narcissism, Don't let her destroy your life!!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Calling Dll's
    By clueless in forum AutoPlay Media Studio 7.5
    Replies: 5
    Last Post: 03-16-2008, 03:48 PM
  2. open source dlls on ams ?
    By goukilord10 in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 04-06-2006, 11:43 PM
  3. DLLs and EXEs for your AMS 5/6 projects - FREE!
    By Intrigued in forum AutoPlay Media Studio 6.0
    Replies: 7
    Last Post: 10-20-2005, 09:26 AM
  4. 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
  5. 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