PDA

Click to See Complete Forum and Search --> : Passing objects with MSMQ


dvrobin
Mar 7th, 2001, 02:51 PM
Ok, MSMQ is supposed to allow me to pass persistent objects, but I'm having a problem getting it to work correctly. I've created a custom object called cCall and set the Persistable property to Persistable(1). I implemented both the WriteProperties and ReadProperties events as shown below. When I go to set the Message Body to the object, I get an error '445', 'Object does not support this action'. Everything seems to be done correctly, but I'm obviously missing something.

Thanks for the assistance!

Note: The Transfer Sub is located in another class in the same project as the cCall object.

Public Sub Transfer(OutBoundCall As cCall)

Set mqTransferMessage = New MSMQMessage

mqTransferMessage.Label = OutBoundCall.TransferToID

mqTransferMessage.Body = OutBoundCall

mqTransferMessage.Send mqTransfer

end Sub

Private Sub Class_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "CallType", CallType
PropBag.WriteProperty "Comments", Comments
PropBag.WriteProperty "Company", Company
PropBag.WriteProperty "Extension", Extension
PropBag.WriteProperty "Originator", Originator
PropBag.WriteProperty "Time", Time
PropBag.WriteProperty "TransferTo", TransferTo
PropBag.WriteProperty "TransferToID", TransferToID
End Sub


Private Sub Class_ReadProperties(PropBag As PropertyBag)
CallType = PropBag.ReadProperty("CallType", "")
Comments = PropBag.ReadProperty("Comments", "")
Company = PropBag.ReadProperty("Company", "")
Extension = PropBag.ReadProperty("Extension", "")
Originator = PropBag.ReadProperty("Originator", "")
Time = PropBag.ReadProperty("Time", "")
TransferTo = PropBag.ReadProperty("TransferTo", "")
TransferToID = PropBag.ReadProperty("TransferToID", "")
End Sub

Bill Crawley
Mar 8th, 2001, 07:23 AM
It's been a while since I used MSMQ, but I think it's because you are trying to send a Class and I dont think that's allowed. An easy way to prove it would be to just send a simple text string. If that works then that's the answer.