64/32 bit DLL's for MT5 terminal

 

    Do we need to create separate 64 and 32 bit DLL's for 64 and 32 bit versions of MT5?  

   Have gone through the article https://www.mql5.com/en/articles/18 but found no mention of requirement of a 64 bit DLL. 

   Trying to run a 32 bit compiled DLL with a 64 bit MT5 terminal gives the following error (eg has an EA calling an indicator which uses a DLL) :

    2011.11.28 01:57:32    XXXX (GBPUSD,M1)    Cannot open 'C:\Metatrader 5\InstaTrader_5 1\MQL5\Libraries\XXX.dll' (193)

   2011.11.28 01:57:32    XXXX    'C:\Metatrader 5\InstaTrader_5 1\MQL5\Libraries\XXX.dll' is not 64-bit version 

 

    Is there a way to have a common DLL between 32 and 64 bit versions of MT5 for easier distribution?

How to Exchange Data: A DLL for MQL5 in 10 Minutes
  • 2010.01.27
  • MetaQuotes Software Corp.
  • www.mql5.com
Now not so many developers remember how to write a simple DLL, and what are special features of different system binding. Using several examples, I will try to show the entire process of the simple DLL's creation in 10 minutes, as well as to discuss some technical details of our binding implementation. I will show the step-by-step process of DLL creation in Visual Studio with examples of exchanging different types of variables (numbers, arrays, strings, etc.). Besides I will explain how to protect your client terminal from crashes in custom DLLs.
 
Unfortunatly it is impossible to load a 32bit DLL to the 64bit terminal or a 64bit DLL to the 32bit terminal.
 
Ilyas:
Unfortunatly it is impossible to load a 32bit DLL to the 64bit terminal or a 64bit DLL to the 32bit terminal.

I am using Microsoft Visual Studio Community 2019 Versión 16.6.3  2019 

and MetaEditor Version 5.00. I have successfully compiled MQL5DLLSamples in MS Visual Studio

also the corresponding mql5dll_test.qm5, both compilations without error, however when  I try to execute expert 

the errors I got are

'C:\Users\USER\AppData\Roaming\MetaQuotes\Terminal\....\MQL5\Libraries\MQL5DLLSamples.dll' is not 64-bit version

Cannot load 'C:\Users\USER\AppData\Roaming\MetaQuotes\Terminal\....\MQL5\Libraries\MQL5DLLSamples.dll' [193]

Cannot call 'fnCalculateSpeed', 'MQL5DLLSamples.dll' is not loaded

unresolved import function call

IS it because MQL5 is 32 bit version? and Microsoft community 2019 is 64 bits??? 

What should I do ?  maybe wait for MQL6 64 bits ????