Creating the client application – Rockwell Automation FactoryTalk Transaction Manager User Guide User Manual

Page 148

Advertising
background image

FactoryTalk Transaction Manager User Guide

148

2. Select Project > References to add a reference to the Microsoft

ActiveX Data Objects 2.5 and COM+ Services Type libraries.

3. Select Project > Project Properties. Click the General tab and change

the project name to ―ComSampleVB.‖ Make sure that the Threading
Model is Apartment Threaded.

4. Recreate Code Sample A at the end of this section in the General

Declarations section of the default class module. Notice the use of the
required ObjectContext object.

1. Declare an object (in this case, ctxObject).

2. Set the object using GetObjectContext().

3. Follow GetObjectContext with your code.

4. End the code with either a SetComplete or SetAbort method on

ctxObject.

5. Save the project and compile into a .DLL file.

Creating the Client Application

The client application is used to test the remote component outside of FactoryTalk

Transaction Manager. A remote component can be used by more than one client.
This process is optional.

To create the client application, complete the following steps:

1. Create a new Visual Basic Standard EXE project.

2. Select Project > Project Properties. Click the General tab and change

the project name to ClientSampleVB.

3. Add a command button to the standard form.

4. Copy Code Sample B at the end of this section and paste it into the

General Declarations section of the form.

5. Save the project.

Advertising