|
To use a Distinct ActiveX control in a Visual J++ applet, the applet
must include definitions of the actions and errors for the control. These definitions are
listed in the D_*.java file (where * represents the control name) shipped with the ActiveX
control. For example, the D_FTP.java file contains the definitions for the FTP control.
The contents of this file must be included in the class that uses the control.
(a) To create a Windows application, you just need to add the ActiveX control and
handle it in the same way you would any other ActiveX control.
(b) To use the controls from within an applet on HTML where a dialog box will pop up,
you need to create a Web Page project and select applet on HTML. Then you need to add a
Form to your project, and add the supplied definitions file to the form. In the applet1
class add the following method:
public void start ( )
{
Form1 abc = new Form1 ();
abc ShowDialog ();
}
Then add your GUI code as needed.
(c) To use a control that includes the User Interface (see the Distinct sample for
this). Start your new project by selecting Web Pages and choosing Code-behind HTML. Open
page1.asp; add the ActiveX control in the HTML tab. All you then need to do is to add the
control to the HTML page in the required position.
Note: You must have the Microsoft Virtual machine for Java and MFC for Java installed
on your system.
How to
Run the Sample Programs in Microsoft Visual J++ 6.0
Following are the step by step instructions on how to run the Distinct
ActiveX sample applications from within Microsoft J++.
- Open the Visual J++ programming environment.
- Choose Open Project from the File menu.
- Use the Browse button to load the sample application. For example for the SmtpApplet
sample browse for the
\samples\vj\vj6\SmtpApplet folder and select the
SmtpApplet.vjp file.
- Choose Customize Toolbox from the Tools menu and click on the ActiveX Controls tab.
Check the Distinct Control or controls being used by the sample application (Distinct SMTP
ActiveX control in this case), and click on OK.
- From the Debug menu select Start Without Debugging. This will run the sample within the
environment.
Where to find the VJ ++ version 6 samples you need
Samples are stored in the VJ6 folder under the VJ folder. Below we describe
what each sample does. The folder column shows the subfolder name that contains one or
more samples and the ActiveX control whose use is illustrated by the sample.
| Folder |
Included Samples |
| FtpApp |
The FtpApp sample illustrates the use of the ftp
client control in a J++ application. The sample connects to an FTP server directly,
through a SOCKS firewall proxy or in passive mode. It changes directories, lists and gets
or put files. |
| FtpApplet |
This ftp sample illustrates how to write a Java applet
that can be added to an html page and that can be executed from Internet Explorer with the
Distinct Controls. The sample uses the FTP control to do this. |
| Script |
This sample illustrates how to add a Distinct control onto an
HTML page that can be executed from Internet Explorer. |
| SmtpApplet |
This is a sample of an applet that can be run from an HTML
page. It can only be executed using Internet Explorer. |
| VisualActiveXHtm |
This sample shows how a Visual Basic ActiveX control can be
used on an HTML page. The control used here has its own user interface that makes use of
the SMTP ActiveX control to send email. No scripting is required to add this type of
control to an HTML page. |
*Get Adobe Acrobat Reader if needed.
|