I am sending to a message queue objects of a type "employee" ( a type that i created), sending part executes properly..
i need to know how i can retrieve the objects properly, how can i serialize it back to "employee" type
currently i'm using the following code.. it doesnt work..
BinaryFormatter binaryFormatter = new BinaryFormatter(); MessageQueue msgQueue = new MessageQueue(MessageQueueName);System.Messaging.
Message msg = msgQueue.Receive();msg.Formatter =
new System.Messaging.XmlMessageFormatter(new string[] { "System.String" });Employee emp = (Employee)msg.Formatter;
MessageBox.Show(emp.Name);

how can i serialize a object received from a MessageQueue?
eric shih
You evaluate the emp with msg.Formatter which returns an IMessageFormatter interface type. So you must implement the interface in the employee class to be compatible to Formatter property.
Here is the signature:
AFM
AHTUNG
Hi,
Have you implemented the IMessageFormatter in your "emplayee" class
Cause msg.Formatter return an object which must have implementation of this interface.
Thank you