DLL string transmission bug (Build 610)

 

Hi,

I'm pointing to a bug with string (unicode) transmission into .DLL

#import "..."
   bool protocol_Auth(string,string);
#import

First example doesn't work good.

class protocol
        {
        ...
        public:
                bool Auth(string _user,string _pass);
        };

bool protocol::Auth(string _user, string _pass)
        {
        return(protocol_Auth(_user,_pass)); 
        //-> library accept 2 string parameters everytime as _user and _user (as the first)
        //-> library debug = _user,_user - WRONG
        }

Second example works fine. (It's also called in protocol::Auth)

protocol_Auth("USER","PASS"); //-> library accept 2 string parameters as "USER" and "PASS" - library debug = "USER","PASS" - OK
 

The mentioned in this topic might not be unicode/ansi string problem.

I've heard same problem as this topic in Twitter. "The second string argument is same as the first at the DLL side"

So, I think more reproduction codes are worth, and should be submitted to MetaQuotes.

 

I've created code to reproduce this bug. Code is on GitHub.

From my tests,

  • With build 610
  • Result is incorrect if run a script from MT4 Terminal
  • Result is correct if run a script from MetaEditor debugger
  • With build 616
  • Results are correct if run a script from both MT4 Terminal and MetaEditor debugger.
So, try the latest (but not the offical) release build 616.