Didn't you try MessageBoxW?
Not yet. But it should be same...I think.
Previous sample toke MessageBoxA function which works for "traditional" character -- ASCII , this time, try MessageBoxW, for Unicode character.
... int MessageBoxW( int, ushort&[], ushort&[], int ); ... void OnStart() { ... ushort Txt[]; ushort Tl[]; StringToShortArray( Text, Txt, 0, -1); StringToShortArray( Title, Tl, 0, -1); MessageBoxW( 0, Txt, Tl, 0 ); }
As you see, ushort replaces uchar , now it works well for Unicode String. So, be careful of type of character.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You may import any Windows Dynamic Link Library (DLL) into your EA/Script, but, in my experience, it is easy to do that for the SIMPLE type like "int", but hard for "string". Watch this:
Test it, you may see that only one character ( the first character of string to show ) is presented, where do the rest go ? The answer is, the type you declared inside "import", "string", is not suitable for the export of the DLL and the calling of your code, try this:
Note that "string" is changed to be "char&" now, and null terminator ('\0') is applied to the end of the character array, that is also called as "C style string".
Now, it should work properly, with luck. Anyway, it works well in my system, a messagebox with "Hello" is there.
However, it is really a bit clumsy, so I find out another smarter way...
Now "uchar&[]" replaces of "char&". Type of "uchar" works for ASCII character which is converted from Unicode String that MetaTrader system used, and, the "&[]" means that it is a pointer for the "uchar" array.
The key is, using "character array", and a pointer which points to that arry, but not "string", actually, that is the way of Windows API.