Make sure (within the DLL) that you marshall the string specifically. Build 600+ broke a lot of DLLs that pass strings. Your MQL4 code may not change at all from the original, but the DLL code will need to specifically marshall the strings as the correct type.
In .NET this can be done as:
something like this for C#:
string GV_GetNamedString([MarshalAs(UnmanagedType.LPWStr)] string StrName, [MarshalAs(UnmanagedType.LPWStr)] string Error);
See this code for more complete examples in C# and the other side in MQL4:
Also, see this topic:
Following code works fine in old builds but not in 600+ builds. In new builds it only passes and get back first letter of the strings. Any one here to tell how to fix this for new builds??
i have wrote a dll which could pass string to mq4(Version 670),you could have a try like the following in your dll:
wchar_t* GV_GetNamedString(wchar_t* StrName, wchar_t* Error);
import in mq4 as you do:
string GV_GetNamedString(string StrName, string Error);
To add comments, please log in or register