When I send a message the message that is placed on the Q has no Body, or if it does I cannot access it.
SendMSMQMessage (L"DIRECT=TCP:192.168.246.241\\private$\\sefaxmodem",L"FaxModemEvent",eventMsg);
The value of eventMessage is - eventMsg = 0x0042a388 "<?xml version="1.0"?><faxModemEvent faxDevice="COM10" eventId="13" pageNumber="1" succeeded="1" Fax Code="0" Line Code="0"> <eventMessage><![CDATA[Completed]]></eventMessage></faxModemEvent>"
void
SendMSMQMessage(LPWSTR QueueName, LPWSTR Label, char* Body) //from faxengine
{
MQMSGPROPS Message;
MSGPROPID PropID[3];
MQPROPVARIANT PropVars[3];
HRESULT hrStatus[3];
PropID[0] = PROPID_M_LABEL;
PropVariantInit(&PropVars[0]);
PropVars[0].vt = VT_LPWSTR;
PropVars[0].pwszVal = Label;
PropID[1] = PROPID_M_BODY;
PropVars[1].vt = VT_VECTOR | VT_UI1;
PropVars[1].caub.pElems = (LPBYTE) Body;
PropVars[1].caub.cElems = (ULONG) sizeof(CHAR)*strlen(Body);
PropID[2] = PROPID_M_BODY_TYPE;
PropVars[2].vt = VT_UI4;
PropVars[2].ulVal = VT_EMPTY; //VT_I1;
Message.cProp = 3;
Message.aPropID = PropID;
Message.aPropVar = PropVars;
Message.aStatus = hrStatus;
QUEUEHANDLE DestQueue;
//
HRESULT hr;
hr = MQOpenQueue(QueueName,MQ_SEND_ACCESS,MQ_DENY_NONE, &DestQueue);
//
hr = MQSendMessage(DestQueue,&Message,MQ_NO_TRANSACTION);
hr = MQCloseQueue(DestQueue);
//
}
hr is OK in all cases.
I am not a C++ programmer so any help I can get is greatly appreciated.
SendMSMQMessage (L"DIRECT=TCP:192.168.246.241\\private$\\sefaxmodem",L"FaxModemEvent",eventMsg);
The value of eventMessage is - eventMsg = 0x0042a388 "<?xml version="1.0"?><faxModemEvent faxDevice="COM10" eventId="13" pageNumber="1" succeeded="1" Fax Code="0" Line Code="0"> <eventMessage><![CDATA[Completed]]></eventMessage></faxModemEvent>"
void
SendMSMQMessage(LPWSTR QueueName, LPWSTR Label, char* Body) //from faxengine
{
MQMSGPROPS Message;
MSGPROPID PropID[3];
MQPROPVARIANT PropVars[3];
HRESULT hrStatus[3];
PropID[0] = PROPID_M_LABEL;
PropVariantInit(&PropVars[0]);
PropVars[0].vt = VT_LPWSTR;
PropVars[0].pwszVal = Label;
PropID[1] = PROPID_M_BODY;
PropVars[1].vt = VT_VECTOR | VT_UI1;
PropVars[1].caub.pElems = (LPBYTE) Body;
PropVars[1].caub.cElems = (ULONG) sizeof(CHAR)*strlen(Body);
PropID[2] = PROPID_M_BODY_TYPE;
PropVars[2].vt = VT_UI4;
PropVars[2].ulVal = VT_EMPTY; //VT_I1;
Message.cProp = 3;
Message.aPropID = PropID;
Message.aPropVar = PropVars;
Message.aStatus = hrStatus;
QUEUEHANDLE DestQueue;
//
HRESULT hr;
hr = MQOpenQueue(QueueName,MQ_SEND_ACCESS,MQ_DENY_NONE, &DestQueue);
//
hr = MQSendMessage(DestQueue,&Message,MQ_NO_TRANSACTION);
hr = MQCloseQueue(DestQueue);
//
}
hr is OK in all cases.
I am not a C++ programmer so any help I can get is greatly appreciated.