Forum

Sane way to deallocate strings from DLL

My DLL specifically constructs strings for my MQL5 code (eg UTF16, null terminated, on the heap). As far as I understood, metatrader will then automatically copy this string for the EA to use. The problem now is that the specifically constructed string still lies somewhere in memory, causing a

Callback to MQ5 code from DLL

A DLL is a major part of my expert advisor. This DLL should be able to send signals to my MT5 terminal. This would either require polling, or a callback. Such callback could for example be utilized to make a trade copier. But it does not seem possible to pass functions as parameters in MQ5, neither