|
|
This project was submitted by:
Jonathan ICHAI
About
The Project
The "Rates" Plug In was created in order to be
integrated into the "Home Budget Software".
The purpose of this Plug In is to update the
exchange rates of the most used currencies in the world, and to make conversions.
The Plug In automatically updates the exchange
rates, retrieving the data from financial websites on the Internet.
If there is no connection, the user is able to
update manually the rates.
Home computer
1.
How to Integrate the Plug In into your project
1.2. Integrating the Plug In into a "Visual Basic" Project
1.3.Integrating the Plug In to a Visual C++ Project
How to integrate the Plug In into your project
The Plug is an ActiveX control.
A short definition:
An ActiveX control is a component program object
that can be re-used by many application programs. ActiveX controls can
be used for any commonly-needed task by an application program in the latest
Windows and Macintosh environments.
Note to java lovers: An ActiveX control is roughly
equivalent in concept and implementation to the Java applet.
In implementation, an ActiveX control is
a dynamic link library (DLL) module. An ActiveX control runs in an application
program that uses the Component Object Model program interfaces. It is
a reuseable component . Windows application development programs
such as PowerBuilder and Microsoft Access take advantage of ActiveX controls.
To the top of page
Integrating
the Plug In into a "Visual Basic" Project
Nothing is more simple.
First, put the PlugIn directory into C:\
Then, put your mouse on the ToolBox of VB (the
tool bar on the left side of the screen) and click the right button.Then
choose "Components..." .
When the components list appears,
click on "Browse" and look for the PlugIn.ocx file of the Plug In. Then,
the Plug In ActiveX will appear in the "Components" list. Now,
a new little icon appears in the ToolBox toolbar.
You are now able to integrate the control in
your project.
Integrating the Plug In to a Visual C++ Project
The following procedure adds dispatch class and header files for an ActiveX control to a Visual C++ project.
Put the PlugIn directory into C:\
On the Project menu, click Add to Project. A
shortcut menu appears.
Click Components and Controls. The Components
and Controls Gallery dialog box appears.
Click the component to add to your project. Visual
C++ displays a dialog box from which you can select a subset of the component's
classes to add to your project.
Click to select the check boxes of the classes
you want to add, and click OK.
Visual C++ generates dispatch class and header
files for the component and adds them to your project.
The "Rates" plug in consists of several functions
you can use as an interface between it and your application. (However,
you can use the Plug In as a "Plug and Play" form in your application,
we will explain that later).
These functions are :
Concerning the configuration:
boolean SelectMCU (currency as string)
Concerning the update process:
boolean GetCurrentRate
(currency as string, rate as string)
boolean GetLastDate
(currency as string, date as string)
boolean UpdateRate
(currency as string, value as string)
(For manual update)
boolean Update () (In order
to update from the Internet)
Concerning the conversions:
double ConvertTo
(currency as string, sum as string)
double ConvertFrom
(currency as string, sum as string)
Once you have integrated the Plug In to your application
(as explained in (3) ) you can use it as an object (whose name by default
in VB is Rates1).
Then, as an example, just type Rates1.SelectMCU
to use the SelectMCU function.
Here is a complete guide explaining how you must
use these functions.
You can use the Plug In by 2 ways.
a. Plug-In and Play !
b. Using the functions
a. "Plug-In and Play"
Once you have integrated the Plug-In into your
project (using the chapter 3 of this manual), just create a new form and
put the ActiveX control in it.
The control is a simple window consisting of
5 tabs.
1)The first tab is called “Rates”. It shows the most commonly used currency and the rates of the main other currencies. You will be able to update these rates using the third tab called “update”
2) The second tab is called “conversion”. In this tab, you can convert a sum from your currency to another currency and vice versa.
3) The third tab is called “Manual Update”. Here, you can update the most commonly used currency name, the rates of the other currencies, the inflation rate and the construction rate.
4)
The fourth tab is called "History". In this tab, you can see the history
of the currencies updates. For each currency, a table shows the past rates
and the dates of the updates.
5) The last tab is called "Configuration".
In this tab, the user configures the system. He first selects the "most
commonly used currency" and then selects the website he wants the data
to come from. He can also test the connection in order to know if he can
update the data from the web.
· First, choose the most commonly used
currency using the combo box located in the top.
· Select the currencies rates you are
interested in using the check boxes located in front of each currency.
After selected, a currency rate must be updated by the user.
· Do the same thing for the inflation/construction
rate.
· If a problem is encountered updating
the data, an error message will appear.
b. Using the functions
The functions detailed earlier can be used as
an interface to access and update data. Indeed, if you want to realize
an interface for the rates conversion by yourself, you can use these functions
and their return values.
To the top of page
In case of problem, or if you have any question, contact the Technical Support by E-mail or by phone:
Phone: 055 326264