Wombat.MamaMsg.tryVectorChar C# (CSharp) Method

tryVectorChar() public method

Try to get a vector of chars.
public tryVectorChar ( string name, ushort fid, char &result ) : bool
name string
fid ushort
result char
return bool
        public bool tryVectorChar(
			string name, 
			ushort fid,
			ref char[] result)
        {
            EnsurePeerCreated();
            IntPtr array = IntPtr.Zero;
            uint size = 0;
            int code = NativeMethods.mamaMsg_getVectorChar(nativeHandle, name, fid,ref array, ref size);
            if (CheckResultCodeIgnoreNotFound(code) != MamaStatus.mamaStatus.MAMA_STATUS_OK)
            {
                return false;
            }

            byte[] bRet = new byte[size];
            Marshal.Copy(array, bRet, 0, (int)size);

            char[] val = new char[size];

            for (int i = 0; i < val.Length; i++)
            {
                val[i] = (char)bRet[i];
            }

            result = val;
            return true;
        }

Same methods

MamaMsg::tryVectorChar ( Wombat.MamaFieldDescriptor descriptor, char &result ) : bool
MamaMsg