MYSQL & MT5: creating a mysql driver for mt5

To add comments, please log in or register
Christian Stern
285
Christian Stern  

Hey all,


i had the plan to use MT5 with mysql but looks like it turns into more work as expected. There is a howto from Eugeniy ( https://www.mql5.com/en/articles/932 ) which explains it very well. But when you try to load his MQLMYSQL.dll it fails because it is not a x64 binary.

My plan is now to migrate this sources to latest mysql 6.1 connector and MT5 x64 support.

So, thats not the problem because he attached his Visual Studio Project and we can compile it for x64. I compiled it with Visual Studio 2017, no problmes so far.

And now here is the "but". Somehow MT5 has Problems with wchar_t variable/function types. I reduced the troubleshooting down to this point:


// return version of MT5 MySQL Version
MT5_API wchar_t* __stdcall cMySqlVersion()
{
    return (L"MT5 MySQL v1.0 ");
}



When i use another return type, then the dll will be loaded.

Does someone has a clue how to solve this problem ? Attached you can find my modified project.


Thanks in advanced

How to Access the MySQL Database from MQL5 (MQL4)
How to Access the MySQL Database from MQL5 (MQL4)
  • 2014.10.21
  • Eugeniy Lugovoy
  • www.mql5.com
The problem of interaction of MQL with databases is not new, however it's still relevant. Use of databases can greatly enhance the possibilities of MetaTrader: storage and analysis of the price history, copying trades from one trading platform to another, providing quotes/trades in real time, heavy analytical computations on the server side...
Files:
To add comments, please log in or register