Coding
A DCOM
Client
Gopalan Suresh Raj
Note |
To
work with any of these samples, you will need the
following: .........................................Microsoft Visual J++ ver 6.0 |
The Steps involved in developing the DCOM Client are
1. Add a new project StockDCOMClient to the StockDCOM project
2. Add COM wrapper of SimpleStocks to StockDCOMClient
3. Add code to Form1.java
4. Build and run the client
1. Add a new project
StockDCOMClient to the StockDCOM project
From Project Explorer | Solution | Add Project | Applications |
Windows Application | Name: StockDCOMClient
From Project Explorer | StockDCOMClient | StockDCOMClient
Properties | ClassPath uncheck the "Merge all
Project-specific ClassPaths in solution" check box.
2. Add COM wrapper
of SimpleStocks to StockDCOMClient
From Project Explorer | StockDCOMClient | Add | COM Wrapper check
the checkbox listed with "SimpleStocks 1.0 Type
Library".
Click "OK" to confirm list of COM Wrappers. Notice that
the stockmarketlib folder was created under the StockDCOMClient
project.
Notice the java source files that have been generated: StockMarket.java and IStockMarket.java.
3. Add code to Form1.java
Form1.java |
import com.ms.wfc.app.*; import com.ms.wfc.core.*; import com.ms.wfc.ui.*; import com.ms.wfc.html.*; /**
// TODO: Add any constructor code after initForm call /**
private void edit1_Leave(Object source, Event e) {
private void button1_click(Object source, Event e) {
/**
private void initForm() {
label1.setLocation(new Point(8, 32));
edit1.setLocation(new Point(168, 32));
label2.setLocation(new Point(8, 80));
edit2.setLocation(new Point(168, 72));
button1.setLocation(new Point(112, 120));
this.setNewControls(new Control[] {
/**
|
4. Build and run the client
click here to go
to the Developing DCOM Server Component from IDL... |
click here to go to My DCOM HomePage... |
This site was developed and is maintained by Gopalan Suresh Raj This page has been visited times since March 17,1999. |
Last Updated : Mar 17, '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. |