Version 9.6
 —  EntireX Broker ActiveX Control  —

Writing Applications - Broker ActiveX Control

This document covers the following topics:


Calling a Broker Function

Setting the Broker ActiveX Properties

You can set the Broker ActiveX properties either in the program or in the property pages.

Specifying the Send Parameters

Before executing a send function, specify the send parameters with the method SetSendDataLong(String bsData, Long DataLen) or SetSendData(String bsData, Short DataLen).

This method sets only the send buffer.

The first parameter specifies the buffer that has to be sent to the server. The second parameter specifies the number of bytes to be transferred.

The following rules apply to the SetSendData method:

Calling the Broker Function

BOOL InvokeBrokerFunction()

This method executes the Broker function defined by the current value of the property Function. Depending on the function, the required Broker parameters are taken from the current values of the corresponding properties.

If the Broker call is successful:

If the Broker call is a Send or Receive function, this call may also update the ConvID property.

If the Broker call is a Receive function and asterisks were specified for ServerClass, ServerName and Service, the call updates the ServerClass, ServerName and Service properties.

If the Broker call is a Receive or Send with implicit Receive (Wait > 0), the number of bytes received is stored in the property ReturnDataLength and the returned data can be retrieved with the GetReceiveData method.

If the Broker call fails:

The error code has two parts:

The GetErrorText method is still available and returns the value of the ErrorMsg property.

For more information see Error Messages and Codes.

Getting the Contents of the Receive Buffer

If a Receive function was executed, the receive buffer can be retrieved with the function

STRING GetReceiveData()

AboutBox

The AboutBox method is used to show the version of Broker ActiveX Control.

A message box will be displayed containing the About information.

AboutBox ()

graphics/about.png

Top of page

Viewing the Type Library

Start of instruction setTo view the Type Library of Broker ActiveX Control

To do this with Visual Basic, see Using Broker ActiveX Control as an Automation Server.

Top of page

Adding the Broker ActiveX Control Component to Visual Studio

Start of instruction setTo add the Broker ActiveX Control component to Visual Studio

  1. In Visual Studio, choose Toolbox > Components.

    graphics/vs1.png

  2. From the context menu, choose Choose Item.

  3. In the Choose Toolbox Items dialog under COM Components, check "EntireX Broker ActiveX Control".

    graphics/vs2.png

    graphics/vs3.png

    EntireX Broker ActiveX Control is now known to Visual Studio. It can be copied and pasted into the new form for later use.

    graphics/vs4.png

Top of page

Using Internationalization with Broker ActiveX Control

It is assumed that you have read the document Internationalization with EntireX and are familiar with the various internationalization approaches described there.

By default, Broker ActiveX Control uses the Windows ANSI codepage to convert the Unicode (UTF-16) representation within BSTRINGS to the multibyte or single-byte encoding sent to or received from the broker. This codepage is also transferred as part of the locale string to tell the broker the encoding of the data.

If you want to adapt the Windows codepage, see the Regional Settings in the Windows Control Panel and your Windows documentation.

With the property LocaleString (see LocaleString in Reference - Broker ActiveX Control) you can prevent a locale string from being sent if communicating with broker version 7.1.x and below (blank out the property for this purpose).

Restrictions

Top of page

Using the Property Pages

If you do not use Transaction Object Repository (TOR) files, you can also supply the properties using the property sheet of Broker ActiveX Control. (If you use Broker ActiveX Control as an automation server, the property pages are not available.)

The property sheet contains the following:

General Page

With this page you can specify the API version and the size of the receive buffer.

Function Page

With this page you can specify the function to be called and Service, Server Class and Server Name.

Parameters Page

With this page you can specify the Conversation ID, Broker ID, User ID, Password, Environment, Wait time, and Option.

Results Page

This page displays the results of the Broker function.

Top of page