Would it be possible to create a C++ wrapper for an activeX dll so that it could be used in AMS?
Professional Software Development Tools
Would it be possible to create a C++ wrapper for an activeX dll so that it could be used in AMS?
Why would you do that when you can just use LuaCOM to work with the ActiveX dll.
Dermot
I am so out of here
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.
Has anyone else tried this at all? I had a go last night but couldnt make the dll work with AMS.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
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++![]()
..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.
Last edited by Dermot; 11-14-2009 at 09:33 PM.
Dermot
I am so out of here
... Thanks. Looks like im going to be busy all weekend
![]()
I found a small patch for VB6 that takes care of the renaming of the linker etc..
It comes with sample code to![]()
I finaly managed to do this to
Ill see if i can get my dynamic masking tool done next .
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.
Ive finnaly discovered how this can be done;
But it does seem that there is a way to handle the COM instantiation correctly so you can use VB normally SolutionVB6 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..
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
then at least we could open the dll in memory and work with it that wayCode:DLL.Open("myfile.dll") DLL.CallFunction("Function",arg0,arg1,arg2) DLL.Close()
Open your eyes to Narcissism, Don't let her destroy your life!!
Could you elaborate?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
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!!