Click to See Complete Forum and Search --> : BinaryMessageFormatter


Toot
May 6th, 2003, 05:35 AM
Hi gurus,

I'm trying to use MSMQ in C# at the sending side and C++ at the receiving end. To start with, it looks good - I can put things on the queue and get them off the other end, of sorts.

My one main problem is that I don't seem to be able to get UNICODE off the queue - strings are always coming through as MBCS. I can cope with that, however.

I think this problem is also causing me a knock-on problem though, and that is proving a little more tricky to solve - my well-formed XML strings that I'm putting on the queue are actually being re-parsed into a string - so things like <MyTag>Hello World</MyTag> are actually coming out as <?xml version="1.0"?><string>&lt;MyTag&gt;Hello World&lt;/MyTag&gt;</string>

So I'm looking at the BinaryMessageFormatter class and I've told my queue to use it:
m_myQueue.Formatter = new BinaryMessageFormatter();

But now I'm not getting anything at the other end. I wonder if it's to do with loose coupling, but I can't find anything useful anywhere and I'm beginning to clutch at straws!

Any and all comments/suggestions/pointers gratefully received!

Toot

Toot
May 6th, 2003, 08:29 AM
Naturally, given a sufficiently long day of ripping my hair out trying to find a way of doing this, it's actually hidden in the depths of MSDN already - see HOWTO: Create a custom message formatter using C# .NET (http://support.microsoft.com/default.aspx?scid=kb;en-us;310683).

Hope that prevents the need for someone else to waste two days :D

Toot