locked
eVC to VC++ 2005 codes migration problem RRS feed

  • Question

  • Dear all,

    First of all I am sorry if I post it in the wrong forum.

    I would like to seek a solution to the problem that I face. I have C++ codes written for WinCE using eVC++. I need to migrate it to VC++ 2005 so that the codes can be run on Windows XP. I have several problems:

    1. The original codes use a header file 'msgqueue.h' which is not available on VC++. Is there any equivalent header file for this on VC++?

    2. If it is not available, what is the alternative way to replace header file msgqueue.h so that the codes can be run on Windows XP?

    Thank you for your help.

    Regards,

    Undetoi

    Tuesday, November 11, 2008 5:17 AM

Answers

  • The desktop OS versions of these functions are MQSendMessage() and MQReceiveMessage().  You'll also need MQOpenQueue().  #include <mq.h> and link Mqrt.lib.  
    Hans Passant.
    • Proposed as answer by ildjarn Tuesday, November 11, 2008 3:12 PM
    • Marked as answer by jack 321 Friday, November 14, 2008 2:38 AM
    Tuesday, November 11, 2008 12:59 PM

All replies

  • Msgqueue.h and msgqueue.lib are Windows CE/Mobile specific, there is no desktop equivelent.

    What is the purpose of the code? What does it do? It's hard to offer an alternative when you only list a header file and not what you use it for.
    Tuesday, November 11, 2008 6:33 AM
  • Hi ildjarn,

    Thanks for your reply. The purpose of the code is to capture the data produce by external device connected through the COM port. One thread gets the data from the device and puts them in a queue using WriteMsgQueue function. Another thread (readThread) reads this raw data in the queue using ReadMsgQueue function which will be passed to another function to parse and present them to the other application.

    Is there any solution to this? Thank you.

    Tuesday, November 11, 2008 7:56 AM
  • The desktop OS versions of these functions are MQSendMessage() and MQReceiveMessage().  You'll also need MQOpenQueue().  #include <mq.h> and link Mqrt.lib.  
    Hans Passant.
    • Proposed as answer by ildjarn Tuesday, November 11, 2008 3:12 PM
    • Marked as answer by jack 321 Friday, November 14, 2008 2:38 AM
    Tuesday, November 11, 2008 12:59 PM
  • Hi Nobugz,

    Thanks you. Sorry, I am new to this message queue, could you provide a simple working code? and the path to set Mqrt.lib?

    Also could you recommend a good book that I need to pick up in order to understand this? I have searched online on how to use message queue but I couldn't understand it.

    Thank you.
    Wednesday, November 12, 2008 9:05 AM
  • Sorry, I can't provide simple code, only complex code that won't fit in a forum post.  The vast majority of programmers use the .NET MessageQueue class or the ActiveX interface in mqoa.dll.  Mqrt.lib is present in the SDK's LIB folder, you don't need to supply the path.  Read the reader reviews on Amazon.com to find a book.  The link I gave you takes you to a relevant book, it won't say anything about C/C++ programming.  I doubt any do.
    Hans Passant.
    Wednesday, November 12, 2008 12:55 PM
  • Hi Nobugz,

    Sorry If I am wrong and so unknowledgeable. I read on Internet, that Microsoft Message Queue is for distributed applications on different terminal to communicate with each other?

    My current codes on WinCE are compiled to be an MFC DLL file and it uses msgqueue.h. Then, this DLL is used by an application. Both DLL and the application are on the same WinCE-based device. I have to migrate the DLL file and the application to be a desktop DLL and application which are running on the same desktop.

    So which one is the appropriate solution for the DLL problem that I encounter? Is it MSMQ or another approach "#include <mq.h> and link Mqrt.lib"?

    Again, pardon me for not having knowledge on this. I got the book you recommended and I will read it. If the code won't fit in this forum post, could you send it to my email?

    Thank you for your help.

    • Edited by Undetoi Friday, November 14, 2008 6:41 AM
    Friday, November 14, 2008 3:10 AM