Preparing Visual Basic programs in Windows
Use this information when considering using Visual Basic programs on Windows.
Note: Outside the .NET environment, support for
Visual Basic (VB) in IBM® MQ has been stabilized at the
V6.0 level. Most new function added to IBM WebSphere® MQ 7.0 or
later is not available to VB applications. If you are programming in VB.NET, use the IBM MQ
.NET classes. For more information, see Using .NET.
Note: 64-bit versions of the Visual Basic module files are not supplied.
To prepare Visual Basic programs on Windows:
- Create a new project.
- Add the supplied module file, CMQB.BAS, to the project.
- Add other supplied module files if you need them:
CMQBB.BAS MQAI support CMQCFB.BAS PCF support CMQXB.BAS Channel exits support CMQPSB.BAS Publish/subscribe
See Coding in Visual Basic for information about using the MQCONNXAny call from within Visual Basic.
Call the procedure MQ_SETDEFAULTS before making any MQI calls in the project code. This procedure sets up default structures that the MQI calls require.
Specify whether you are creating an IBM MQ server or client, before you compile or run the project, by setting the conditional compilation variable
MqType
. Set MqType
in a Visual Basic project to 1 for a server or 2 for a client as follows:- Select the Project menu.
- Select
Name
Properties (whereName
is the name of the current project). - Select the Make tab in the dialog box.
- In the Conditional Compilation Arguments field, enter this for a server:
or this for a client:MqType=1
MqType=2