casting from char* to CString* is unsafe as you dont know how CString is
implemented. It can be even not null-terminated ( and most likely this is
true as its responsible to hold both wide and non-wide characters ) inside
and in such case the "LogMEssage" internally may call something like
"GetLength() {return m_Length;}" but physically there is only
null-terminated char buffer or whatever JSON stuff can holds. First check
if the "x" is not NULL after GetVall call and then try to create CString
stringObj ( x ) and log it.

Reply via email to