Microsoft KB Archive/191534

= How To Use MSMQ C API With Compilers Other than Visual C++ =

Article ID: 191534

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Message Queue Server 1.0

-



This article was previously published under Q191534



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


 * 1) if defined(_MSC_VER) && (_MSC_VER < 1020)

-to-


 * 1) if defined(_MSC_VER) && (_MSC_VER < 1020) || defined(MY_COMPILER)

For example:


 * 1) 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

