MQL script giving output only for the first time not 2nd time onwards. I have to close the meta trader terminal to get the output again.
[...] Can someone please help me fix this issue?
You need to put some logging inside your DLL to see how far it is getting. It sounds as though it must be dying inside SDK_JTEST(), in a way which isn't logged as an exception by MT4.
One possible reason is that your data could be said to have 2 rows and 20 columns, rather than vice versa. Are you certain that you are passing the data in the form which SDK_JTEST() expects? What happens if you do SDK_JTEST(..., i_Cols, i_Rows,...) instead of SDK_JTEST(..., i_Rows, i_Cols,...) ?
You need to put some logging inside your DLL to see how far it is getting. It sounds as though it must be dying inside SDK_JTEST(), in a way which isn't logged as an exception by MT4.
One possible reason is that your data could be said to have 2 rows and 20 columns, rather than vice versa. Are you certain that you are passing the data in the form which SDK_JTEST() expects? What happens if you do SDK_JTEST(..., i_Cols, i_Rows,...) instead of SDK_JTEST(..., i_Rows, i_Cols,...) ?
Thanks jjc for you reply. SDK_JTEST is getting data the way it wanted else it wouldn't return outputs to the i_Out_1 and i_Out_2 variables.
I converted the DLL to C++ console application and passed the 1D arrays from main() function to JH_Test(). It ran with out any issue no matter how many times I run. So atleast with in C++ code there is no issue I can say.
I will try to add logging with in the DLL and see what happens.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello All,
I am creating a MQL4 script which imports a C++ DLL to access some functions. The imported C++ DLL is created by me and it invokes third party licensed C++ libraries to perform some mathematical calculations.
I am able to run the code with out any issues and I get the expected output but only for the first time. When I try to rerun the MQL script 2nd time onwards, I am not getting the output [No run time errors]. If I close the meta trader terminal and rerun the script, I get the output again. Can someone please help me fix this issue? Given below is my code:
MQL4 Script
C++ DLL Code
Thanks in advance.