DLL transmit messages to mql script

 

Hello,


I am using plain C to write dll's for use within scripts in metatrader.


1) In my dll I want to create a dialogue or window (which obviously must have its own callback function). I have done this by creating the window in a new thread. This sometimes crashes metatrader when I close the window. Im not really sure if its a good idea to create new windows from within a dll... what do you think?


2) I would like controls on my dll dialog to be able to communicate back to the mql script in someway. So for example I check a checkbox on my dialog and this somehow calls back to the mql script, which could set a variable to save the checkbox state within the script. Is this possible or not ?


Very many thanks for your consideration and time.

 
I may be wrong, but I think MT4 will have to ask the DLL if there is any work to do.
Reason: