This section explains how to use the sample .NET component and client that ships with the adapter.
Sample source code, written in C#, is provided in the \examples\CSharp
directory of the adapter installation, and illustrates how the adapter can interoperate with C# code. Although the sample source code is written in C#, code can be written in any .NET CLS-compliant language (for example, Visual Basic .NET).
The examples\CSharp\Operation
directory contains a C# class library project that defines a class Testobj1
. The Testobj1
class is similar to the C++ Testobj1
class in the examples\Operation\Operation2
directory of the adapter installation.
The examples\CSharp\TestInterceptor
directory contains a C# console application project that defines a client program. This TestInterceptor C# client is similar to the C++ client in the examples\testinterceptor
directory of the adapter installation.
The SampleCSharp.dat
available in the examples
directory is a sample repository that contains:
Testobj1
classOperation.Testobj1.CSharpClient
in the TIBCOCOMInterceptor1
adapter instance, that references the Testobj1
classOperation.Testobj1.CSharpServer
in the TIBCOCOMService1
adapter instance, that references the Testobj1
class.Operation
project using Visual Studio .NET (VS .NET). Modify the path for the assembly key file in AssemblyInfo.cs
to match the adapter installation.
When you build the project, VS .NET will register the Testobj1
class for COM interoperability, generating a COM type library, Operation.tlb
, in the tibco\adapter\adcom\5.3\examples\CSharp\Operation\bin\Debug
directory, and will write most of the required entries into the Microsoft Windows registry.
Before building the project, you can verify that VS .NET will register Testobj1
for COM interoperability. In the Solution Explorer window, right-click the Operation node and select Properties from the shortcut menu; select Configuration Properties > Build > Outputs and make sure Register for COM Interop
is set to True
.
SampleCSharp.dat
already contains the type information from the Operation.tlb
type library, but you must reimport this information after building the Operation
project. To do so, import the type library from the Import Schema
tab in TIBCO Designer. The Import Schema
tab is available when you select the Advanced Services
folder in the project panel:
TestInterceptor
project using Visual Studio .NET.TIBCOCOMService-system:repourl <
Install_Dir
>\adapter\adcom\5.3\Samples\SampleCSharp.dat -system:configurl "Adapter for COM/Service Instances/TIBCOCOMService1"
TestInterceptor
executable.
TIBCO Adapter™ for COM User’s Guide Software Release 5.3, September 2005 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |