Below is the piece of code written in c++, how can i convert it in c#. If you check the pams_get_msgw function , the first param is of (char*), how can i pass the same in c# .
struct
{
short m_nStatus;
short m_nReg_Id;
short m_nNumber_Reg;
}
oRegReply;
short nBufSize = sizeof(oRegReply);
q_address oSenderQueue;
nMsgType = MSG_TYPE_SBS_REG_REPLY;
cPriority = 0;
lTimeout = 300;
lStatus = pams_get_msgw((char *) &oRegReply, &cPriority, &oSenderQueue,
&nMsgClass, &nMsgType, &nBufSize, &nMsgLen,&lTimeout,
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
My c# declaration for pams_get_msgw function is like this
[DllImport("DmqCl32.dll")]
public static extern int pams_get_msgw(StringBuilder msg_area, string priority, out q_address source,
out short clas, out short type,
ref short msg_area_len, out short len_data, ref int timeout,
ref int sel_filter, out PSB psb, out ShowBuffer show_buffer,
ref int show_buffer_len, ref int large_area_len, out int large_size,
[MarshalAs(UnmanagedType.LPStr)] string nullarg_3);
How can i pass structure into first argument, the way doing in c++ ?