HOWTO: Use MSMQ C API With Compilers Other than Visual C++

ID: Q191534

The information in this article applies to:

SUMMARY

This article describes how to build a Microsoft Message Queue Server (MSMQ) C API application using compilers other than Visual C++ or using earlier versions of Microsoft Developer Studio.

MORE INFORMATION

You can develop MSMQ applications with compilers other than Visual C++. However, some third party compilers do not define the structure tagPROPVARIANT in their standard 'include' directory. The file Mq.h contains a definition of an equivalent structure that is #ifdefed currently for Microsoft Developer Studio (MSDEV) versions earlier than version 4.2. In order to use the Mq.h file with another compiler, you must modify Mq.h and define that structure for your compiler in the following way:

   Change line 29 in MQ.H from

      #if defined(_MSC_VER) && (_MSC_VER < 1020)
   -to-

      #if defined(_MSC_VER) && (_MSC_VER < 1020) || defined(MY_COMPILER)

For example:

#if defined(_MSC_VER) && (_MSC_VER < 1020) || defined (__BORLANDC__)

Linking with Mqrt.lib

Some compilers, such as Borland C, use library files in a 32-Bit object- module-format (OMF) while the library files provided with the MSMQ Software Development Kit (SDK), are in a Common Object File Format (COFF) format.

Borland users can create a 32-Bit OMF library from the Mqrt.dll file using the implib tool. For example:

   implib mqrt.lib %windir%\system32\mqrt.dll

REFERENCES

Microsoft Message Queue Server SDK Help

Additional query words: MQProg MQVC

Keywords          : MQProg MQVC 
Version           : WINNT:1.0
Platform          : winnt
Issue type        : kbhowto

Last Reviewed: August 20, 1998