dingmaotu / mql4-lib

MQL4/5 Foundation Library For Professional Developers
Apache License 2.0
544 stars 251 forks source link

Compilation error in 'HelloWorldServer.mq4' file #61

Closed barmenteros closed 1 year ago

barmenteros commented 1 year ago

First of all, congratulations on such an amazing job!

I tried to compile the file 'HelloWorldServer.mq4' in MetaEditor version 5 build 2401 but I get the following error:

'=' - type mismatch GlobalVariable.mqh 292 12

In 'GlobalVariable.mqh', the line in question is this one:

m_hm = new HM;

Could it be that the pointer is expecting to receive a 'HandleManager' object but is receiving a 'Context' object? Or am I missing something in the implementation and use of this example?

Could you help me with this?

Thanks in advance

dingmaotu commented 1 year ago

I compiled in build 3914 and found no error. Maybe it was a compiler bug and got fixed in newer versions. In Context class, HM is ContextHandleManager, which is a subclass (or implementation) of interface HandleManager, and should be OK to be assigned to its parent.

barmenteros commented 1 year ago

You're right. Compiled in build 3915 with no issues. Thank you for your response and for the excellent job in this library too.