Possible to import DLL from server? - page 2

To add comments, please log in or register
JC
1587
JC  
Ex Ovo Omnia:
Then it is not relevant to discuss downloading the DLL from MQL, when you already have the custom shell DLL on its place.

Sure. I was, separately, just saying that there are ways of having a DLL which is updated while MT4 is running. What you raised, as I understand it, is a different topic to the original one. It is (a) possible to do something equivalent to #import "http://myserver/mydll.dll", and (b) possible to update a DLL while MT4 is running - provided that there's a layer between MT4 and the DLL which actually contains the functionality.

You could combine (a) and (b) - download two DLLs, one of which is a shell, and the other of which is then further updateable while MT4 is running.

Ex Ovo Omnia
3461
Ex Ovo Omnia  
JC:

Sure. I was, separately, just saying that there are ways of having a DLL which is updated while MT4 is running. What you raised, as I understand it, is a different topic to the original one. It is (a) possible to do something equivalent to #import "http://myserver/mydll.dll", and (b) possible to update a DLL while MT4 is running - provided that there's a layer between MT4 and the DLL which actually contains the functionality.

You could combine (a) and (b) - download two DLLs, one of which is a shell, and the other of which is then further updateable while MT4 is running.


Yes, it is complicated currently. Up to the 509 version I could download, invoke and delete the library, and it stayed loaded while there was no file left on the hard disc. It helped me a lot to protect my code some time ago.
JC
1587
JC  
Ex Ovo Omnia:

Up to the 509 version I could download, invoke and delete the library, and it stayed loaded while there was no file left on the hard disc.

I'm curious as to how this can have been possible.

What's changed is that MT4 used to create a new thread to handle each tick, and now instead assigns an EA to a single thread throughout its lifetime. But, in order for you to be able to delete the DLL, MT4 must, in each individual tick/thread, have been loading the DLL and then unloading it at the end of the tick/thread. I've got a vague memory of that behaviour, but the performance of DLL calls will have been significantly worse than it is now.

I might dig out a pre-509 build just to satisfy my curiosity.

JC
1587
JC  
Ex Ovo Omnia:

Yes, it is complicated currently. Up to the 509 version I could download, invoke and delete the library, and it stayed loaded while there was no file left on the hard disc. It helped me a lot to protect my code some time ago.
... It looks like it's in fact still possible to do this, albeit not in a way which I'd rely on. You can use GetModuleHandleW() to get the handle to the loaded DLL, and then FreeLibrary() to release it. The DLL is then deleteable. But there's a strong risk of that causing instability in MT4, or incompatibility with future builds.
12
To add comments, please log in or register