Developing
The Bank Account IDL
Gopalan Suresh Raj
Note |
To
work with any of these samples, you will need the
following: .........................................Microsoft Visual J++ ver 6.0 .........................................Windows NT 4.0 Options Pack .........................................guidgen.exe and midl.exe from Microsoft Visual C++ ver 6.0 |
In Visual J++, the most simplest method to create an MTS server component is to first write your server code in pure Java and then create a COM wrapper for it. However, creating the component from scratch using the IDL will allow you more flexibility and control in coding the server component. Hence, we will develop our Bank Account from scratch using IDL.
The Steps involved in developing the MTS Server component are
1. Code the IDL
2. Compile the IDL and generate the type library
1. Code the IDL
Write the code for the IDL as follows. Use guidgen.exe where necessary to generate new UUIDs. Code the
Checking and Savings Account interfaces and create interfaces to
access the Primary Key so that if we need to have a collection of
keys that form our primary key, we can work easier.
Bank.idl |
[ uuid (07D690F0-FB95-11d2-97E3-006097A7D34F), version (1.0) ] library Bank { /*
/*
/*
/*
/*
/*
/*
/*
/* |
2. Generate the type
library from the IDL
Use the midl.exe that comes with your VC++ to compile the IDL
files. If the VC++ environment variables are not loaded use the
full path to midl.exe. Notice that Bank.tlb will now appear.
MS DOS Command Prompt |
E:\com\gopalan\AccountMTS> E:\com\gopalan\AccountMTS>midl Bank.idl Microsoft (R) MIDL Compiler Version 5.01.0164 Copyright (c) Microsoft Corp 1991-1997. All rights reserved. Processing .\Bank.idl Bank.idl Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl oaidl.idl Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl objidl.idl Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl unknwn.idl Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl wtypes.idl E:\com\gopalan\AccountMTS> |
click here to go
to the Developing the Checking Account MTS Server... |
click here to go to My MTS HomePage... |
This site was developed and is maintained by Gopalan Suresh Raj This page has been visited times since April 26,1999. |
Last Updated : Apr 26,'99 |
Copyright (c) 1997-99, Gopalan Suresh Raj - All rights reserved. Terms of use. |
All products and companies mentioned at this site,are trademarks of their respective owners. |