Synchronize mql-zmq changes on Lang/Native; add MqlTick and MqlRates support for ZmqMsg

This commit is contained in:
Ding Li
2018-02-12 09:33:43 +08:00
parent df54353865
commit 4468c27d30
2 changed files with 30 additions and 25 deletions
+4 -10
View File
@@ -143,16 +143,10 @@ string StringFromUtf8Pointer(intptr_t psz,int len)
if(len < 0) return NULL;
string res;
int required=MultiByteToWideChar(CP_UTF8,0,psz,len,res,0);
StringInit(res,required);
int resLength = MultiByteToWideChar(CP_UTF8,0,psz,len,res,required);
if(resLength != required)
{
return NULL;
}
else
{
return res;
}
// need to include the NULL terminating character
StringInit(res,required+1);
int rlen=MultiByteToWideChar(CP_UTF8,0,psz,len,res,required);
return rlen != required ? NULL : res;
}
//+------------------------------------------------------------------+
//| for null-terminated string |