carry dll inside .ex4

 

Is it somehow possible to carry dll as byte array in body of compiled .ex4 and deploy it at run-time and call functions? Does anybody have experience with it please?

 

thanks 

 
fx1.net:

Is it somehow possible to carry dll as byte array in body of compiled .ex4 and deploy it at run-time and call functions? Does anybody have experience with it please?

The purpose of doing that isn't immediately apparent. You could potentially try to pack a DLL into an .ex4 file as something which the compiler regarded as a bitmap. However, in order to deploy it, you'd need the "Allow DLL imports" setting turned on - in order to extract the package into something like MQL4\Libraries.

If you have "Allow DLL imports", then there are many reasons why it would be preferable - and simpler - to download the DLL from a remote server rather than trying to unpack it from the .ex4.

 
jjc:

The purpose of doing that isn't immediately apparent. You could potentially try to pack a DLL into an .ex4 file as something which the compiler regarded as a bitmap. However, in order to deploy it, you'd need the "Allow DLL imports" setting turned on - in order to extract the package into something like MQL4\Libraries.

If you have "Allow DLL imports", then there are many reasons why it would be preferable - and simpler - to download the DLL from a remote server rather than trying to unpack it from the .ex4.

The compiler accepts only bitmaps in a supported format, as I remember. Dont think that this could work that way. At least you would have to have a valid header. 
 
fx1.net:

Is it somehow possible to carry dll as byte array in body of compiled .ex4 and deploy it at run-time and call functions? Does anybody have experience with it please?

 

thanks 

I used to do that for ex4 libraries, which probably had the same mechanics of loading. Up to 509 it worked, as the script loaded the library not earlier than with its first call. But now, it is no longer possible, as the MQL script loads the library immediately on launch.

Reason: