int sendMsg(std::string message, QUEUEHANDLE queuePtr) { HRESULT status; MQMSGPROPS msgProperties; const int NUMBEROFPROPERTIES = 2; WCHAR tmpBodyMsg[] = L"RISQ first message"; MSGPROPID msgPropertyID[NUMBEROFPROPERTIES]; MQPROPVARIANT msgPropertyVariant[NUMBEROFPROPERTIES]; HRESULT msgStatus[NUMBEROFPROPERTIES]; int propIndex = 0; DWORD bodyType = VT_BSTR; msgPropertyID[propIndex] = PROPID_M_BODY_TYPE; msgPropertyVariant[propIndex].vt = VT_UI4; msgPropertyVariant[propIndex].ulVal = bodyType; propIndex++; msgPropertyID[propIndex] = PROPID_M_BODY; msgPropertyVariant[propIndex].vt = VT_VECTOR | VT_UI1; msgPropertyVariant[propIndex].caub.pElems = (LPBYTE)tmpBodyMsg; msgPropertyVariant[propIndex].caub.cElems = sizeof(tmpBodyMsg); propIndex++; // intialize MQQUEUEPROPS structure msgProperties.cProp = propIndex; msgProperties.aPropID = msgPropertyID; msgProperties.aPropVar = msgPropertyVariant; msgProperties.aStatus = msgStatus; status = MQSendMessage(queuePtr, &msgProperties, NULL); if(status != MQ_OK)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)