C# dll returns numbers instead of string (unmanaged exports)

 

I have the following C# function:

 

[DllExport("Call", CallingConvention = CallingConvention.StdCall)]
        [return: MarshalAs(UnmanagedType.LPWStr)]
        public static string Call(
            [MarshalAs(UnmanagedType.LPWStr)]string parameters
            , [MarshalAs(UnmanagedType.LPWStr)]string host)
        {
            try
            {
		string resultValue = "some string";
                return resultValue;
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

The requests are executed correctly, however the response is always a number like this: '91801944'

If I put a message box inside the dll, I can see that the returned string is accurate and displayed correctly. Somehow the string is being converted to numbers while it is passed as return value to mt4 platform. Do you have any idea how I can fix this issue ? 

 
show the relevant MQL code please
 
#import "SST.dll"
   int Call(string, string);
#import

string strRet = Call("EURUSD;0;0;1", "somehostvalue");
Print(strRet);
 
moreevilthanyou:

   int Call(string, string);
 
moreevilthanyou:

The return type from your function "Call" is a string, not an int! See this:

#import "SST.dll"

   string Call(string parameters, string host);

#import

Reason: