CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Devon, UK
    Posts
    212

    BinaryMessageFormatter

    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
    Code:
    <MyTag>Hello World</MyTag>
    are actually coming out as
    Code:
    <?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:
    Code:
    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
    Some cause happiness wherever they go; others, whenever they go.

  2. #2
    Join Date
    Nov 2002
    Location
    Devon, UK
    Posts
    212

    Lightbulb If you're interested

    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.

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

    Toot
    Some cause happiness wherever they go; others, whenever they go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured