How to Send C++ Struct Message from C# Socket?
<p>This is the C++ Message that i need to pass from C#:</p>

<pre>

struct   LoginMessage:public NMessage
{

 char   szUser[ 16 ];
 char   szPass[ 16 ];

    LoginMessage()
    {
       msgId   = CTRL_SESSION_LOGIN;
       msgSize = sizeof( LoginMessage );
    }

};

struct NMessage
{
    DWORD           msgSize;
    union
    {
        DWORD       msgId;
        struct
        {
            BYTE    msgId0;
            BYTE    msgId1;
            BYTE    msgId2;
            BYTE    msgId3;
        };
    };

    NMessage() 
    {
    }

    BOOL IsLegal()
    {
        return msgSize>=sizeof(NMessage) && msgSize
</pre>

<p>What is the equivalent of this in C# so that C++ can understand this message?
Sample code is greatly appreciated.</p>
