| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| mql4_mysql_ansi2uniqode stopped working? https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4056 |
Page 1 of 1 |
| Author: | BobbyT [ Fri Jan 16, 2015 12:28 am ] |
| Post subject: | mql4_mysql_ansi2uniqode stopped working? |
Hello all, Last year I was working on an EA that relies on calling data from MySQL using "mql4-mysql.mqh" include and "libmysql.dll" dll library. Due to life and what not I had to put it on the back burner for a while. I fired it up again this week to find it crashing the terminal. I have tracked it down to the mql4_mysql_ansi2unicode function which is called from the include file. For the life of me I can't work out what has happened. Code: Select all Cheers, BobbyT Edit: I should probably say that there are no issues connecting to the database nor writing data to it. In fact, the above function has a block removed which adds all the available data when there is non present in the target table. What code is left is meant to retrieve the datatime stamp of the last bar entered to the database. This value is then used by other functions to back fill any missing data. |
|
| Author: | renexxxx [ Fri Jan 16, 2015 1:04 am ] |
| Post subject: | mql4_mysql_ansi2uniqode stopped working? |
Did you get the latest MySQL library for build 600+ from https://www.mql5.com/en/code/11114? |
|
| Author: | BobbyT [ Fri Jan 16, 2015 1:37 am ] |
| Post subject: | mql4_mysql_ansi2uniqode stopped working? |
Hi Rene, Thanks for the reply. Yeah this is the version I'm using. Even tried the version from github as it is kept more up to date. trying to implement the stuff from here this morning: https://www.mql5.com/en/articles/932 I'll keep you posted. if you (or anyone else) have any solutions that would be great. It will save me from having to do an extensive rewrite Cheers, BobbyT |
|
| Author: | renexxxx [ Fri Jan 16, 2015 2:01 am ] |
| Post subject: | mql4_mysql_ansi2uniqode stopped working? |
Hi BobbyT, I can't replicate your setup, as I don't have your data model and the rest of your code. What strikes me though is this: Code: Select all mql4_mysql_ansi2unicode needs an integer memory address (which is 'row') and returns a string. You assign that string to 'row', which is an integer --> not good. You may have to have a look at what they do with the memcpy stuff to get the results of the mysql_fetch_row into MQL4, like so: Code: Select all |
|
| Author: | BobbyT [ Fri Jan 16, 2015 2:16 am ] |
| Post subject: | mql4_mysql_ansi2uniqode stopped working? |
I had previously tried setting row at string and that made difference to the problem. I'm a bit miffed as to whats happening as this had worked previously. I'll have a play with your suggestion when I get my head around it I also tried implementing this: https://www.mql5.com/en/articles/932 After swapping out the connection block with my existing connection block: Code: Select all The code for the retrieval is as found below with the original (and defunct) connection code commented out: Code: Select all Edit: What would you need from me (code, data etc) to help you help me a bit easier |
|
| Author: | BobbyT [ Fri Jan 16, 2015 4:03 am ] |
| Post subject: | mql4_mysql_ansi2uniqode stopped working? |
Yeah boi!!! After doing this all morning: http://www.youtube.com/watch?v=WmPkqkqAxyc I arrived at this: Code: Select all From this: https://www.mql5.com/en/articles/932 Thanks for your help Rene. Even though I still can't make heads or tails of that block you posted Let the rebuilding commence (After I get back from my parents for the weekend |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|