mtapi icon indicating copy to clipboard operation
mtapi copied to clipboard

MtApi5.ex5 expert not loading in MT5

Open dd-ctss opened this issue 4 years ago • 4 comments

Hi, The previous and the latest versions of the MtApi5.ex5 expert are now not loading in MT5 terminals. The errors which are showing in the MT5 Toolbox for Experts are as follows:

  • Cannot call 'initExpert', 'MT5Connector.dll' is not loaded
  • unresolved import function call

I have checked that the MTApiService.dll is loaded into the GAC using the command: gacutil /l MTApiService

The MT5Connector.dll file location, is referenced in the PATH and is physically located in c:\windows\system32 and in the MT5 Libraries folder.

Please advise on how best to resolve this problem, as everything was previously working well, thanks.

dd-ctss avatar Mar 21 '20 16:03 dd-ctss

Did you use the official realease? https://github.com/vdemydiuk/mtapi/releases/tag/MT5-v1.0.20

KptKuck avatar Jun 18 '20 10:06 KptKuck

@dd-ctss Please check that you are using correct build configuration of MT5Connector.dll. If your MetaTrader terminal is 64-bit than the library also must be built in x64 mode. MtApi installer places MT5Connector.dll into window system folder (\Windows\System32\ for x64 version, and \Windows\SysWOW64\ for x32), and it places MTApiService.dll into GAC as you mentioned before.

vdemydiuk avatar Aug 26 '20 20:08 vdemydiuk

@vdemydiuk

Please check that you are using correct build configuration of MT5Connector.dll. If your MetaTrader terminal is 64-bit than the library also must be built in x64 mode.

Right...

MtApi installer places MT5Connector.dll into window system folder at:
C:\Windows\System32\ for the x64 version, and
C:\Windows\SysWOW64\ for the x32 version.

That doesn't sound correct. Why would the 64-bit version be installed in the 32-bit location? And why is the MT5Connector.dll a 32-bit version of DLL and placed in 64-bit location when installed from the 32-bit installer? (See #221) AFAIK, MT5 is always 64-bit?

Also, why are you trying to import MTConnector.dll, in MtApi.mq4, if only MT5Connector.dll are installed / is available?

  • https://github.com/vdemydiuk/mtapi/blob/master/mq4/MtApi.mq4#L11

eabase avatar Nov 02 '20 11:11 eabase

Ok, please disregard half of that last comment. I got caught with pants down by the insane MS logic of putting 64-bit in System32 and 32-bit in SysWOW64. :no_entry:

  • https://www.samlogic.net/articles/32-64-bit-windows-folder-x86-syswow64.htm

eabase avatar Nov 02 '20 11:11 eabase