Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Send MSMQ message using C# without serialization?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tbone - 31 Jan 2008 17:18 GMT
Is there any way to send a Message without having the .NET framework add the
"serialization" data to the body of the message?  I am sending binary
structures in the message and I need full control over what is in the body
of the message.  I see some extra bytes before and after the message I asked
the system to write.  I am looking for a way to get rid of those so I can
send binary structures in messages to a C++ program and vice versa.

I am using the following code to send a message:
---
MessageQueue messageQueue = new MessageQueue(@".\private$\test");
byte[] buffer;  // binary structure is in this array
Message message = new Message(buffer, new BinaryMessageFormatter());
messageQueue.Send(message);
Nicholas Paldino [.NET/C# MVP] - 31 Jan 2008 19:33 GMT
Well, you can always have the C++ code deserialize the message through
the .NET framework and then access the object serialized on the message.

   If you really must control all the bytes on the message, instead of
setting the Body property on the Message, you can set the BodyStream
property to a Stream that will contain the data to be sent.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Is there any way to send a Message without having the .NET framework add
> the "serialization" data to the body of the message?  I am sending binary
[quoted text clipped - 9 lines]
> Message message = new Message(buffer, new BinaryMessageFormatter());
> messageQueue.Send(message);

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.