Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Knowledgebase

Products Downloads Sales Support About us
VIT



        
 

To use a Distinct ActiveX control in a Visual Basic application, the application must include definitions of the actions and errors for the control. These definitions are listed in the D_*.TXT (where * represents the control name) shipped with the ActiveX control. For example, the D_FTP.TXT file contains the definitions for the FTP control. This file must be included either in the GLOBAL.BAS module or in the declarations section of each form that uses the control. If it is in the declarations section of each form, then remove the Global keyword from each entry in the file. Next the Distinct ActiveX control must be added to the project. This is accomplished by choosing the Component command from the Project menu of Visual Basic and selecting the Controls tab. (Note in VB 4 Choose the Distinct ActiveX control of interest from the list of available controls.)

Note: If you are using Visual Basic version 5 please make sure that you have service pack 3 installed on your system.

How to create the Distinct ActiveX controls dynamically and still get events in VB6

To add one of the Distinct controls dynamically to your application in Visual Basic Version 6 AND capture events:

  1. Create your VB project.
  2. Add the Distinct ActiveX control as a reference. You do this by selecting the Reference command in the Project menu. This will pop up the Reference dialog box that allows you to Browse for the ActiveX control to be referenced. To view only the ActiveX controls, set the file type to "ActiveX Controls (*.OCX)". For example the full path for the FTP ActiveX control is C:Program FilesCommon FilesDistinctSharedd_ftp32.ocx.
  3. Use the NEW function to create the ActiveX control dynamically. Following is a code segment that illustrates how to do this.
    
    / The following line is to be added
    
      under the declaration section
    
    Public WithEvents m_ftp As D_FtpLib.FtpClient
    
    
    
    / Create an instance of the control
    
      Set m_ftp = New D_FtpLib.FtpClient
    
    
    
      ...  
    
    
    
    / Connect to the ftp server
    
      result = m_ftp.Connect(Host, User, Passwd, "")
    
    
    
    / Destroy instance of control
    
      Set m_ftp = Nothing
    
    
    
    End Sub
    
    
    
    / You need to handle events as shown below
    
      Private Sub m_ftp_OnConnect()
    
      ...
    
    
    
    End Sub
    
    

How to Run the Sample Programs in Visual Basic

Samples for all controls are provided for versions 4, 5 and 6 of this environment. The most extensive set of samples is provided for Visual Basic Version 6. To run a sample in version 4, 5 or 6, follow these instructions:

  1. Open the Visual Basic development environment.
  2. Choose Open Project from the File Menu.
  3. Use the browse feature to find the sample you wish to run. For example if you want to run the SMTP with MIME sample in Visual Basic ver 6.0, choose …samplesvb6mimesmtp folder.
  4. Choose smtpmime.vbp.
  5. Once the sample has loaded chose Start from the Run Menu. This will run the sample.

Notes:

  1. For versions 4 or 5 of Visual Basic click on the appropriate folder VB4 or VB5, then follow the same instructions.
  2. If you are using Visual Basic Version 5.0, please make sure that you have also installed service pack 3.

Where to find the Visual Basic samples you need

Below we describe what each sample does. Samples are stored in subfolders below each Visual Basic folder, that is, VB4, VB5 or VB6. The folder column shows the subfolder name that contains one or more samples and the ActiveX control whose use is illustrated by the sample. When samples are available in only one or two of a VB version, this is indicated.

Folder Included Samples
Apthread (uses the FTP client ActiveX) This folder contains two samples that illustrate the use of the apartment threading feature in the Distinct ActiveX controls (VB 6):

Multiple: This subfolder contains a sample called ThreadDemo. This sample application illustrates how to have your application do multiple concurrent get operations. To simplify this sample, it is hardcoded to connect automatically to the Distinct FTP site when the user selects Get File from the file menu and transfers a predefined test file to the screen using an event based file transfer when the user clicks on the Start Getting the File button. The user can run several of these operations concurrently, with each Get an instance of the ActiveX component is created with its own thread.

Note: this sample should be executed from outside the Visual Basic environment.

Shared: This subfolder contains a sample that is also called ThreadDemo. This sample illustrates how the methods of the ActiveX control can be shared by other threads.

Finger (Finger ActiveX) The finger sample program illustrates how to include Finger functionality into an application using the Finger ActiveX control.
Firewall (Firewall ActiveX) There are three samples in this folder each of which illustrate how to program your application to handle connections through SOCKS firewalls:

Daytime: This shows you how to make a connection to a remote host through a firewall and how to retrieve the hosts reply.

Send: This sample shows how to connect to a host through a firewall server to send a message. The FirewallSend can be used to send a message to the FirewallRecv sample.

Recv: This sample does not use the Firewall ActiveX, it is a sample to illustrate how the receiving of data sent through the firewall works (refer to the Send sample). It is a sample that uses the Windows Sockets control.

FTPCLNT (FTP Client ActiveX) This folder contains four subfolders, each with one or more samples. These samples illustrate the various features that are included in the FTP ActiveX. Below is a description of what each subfolder contains including additional samples for appartment threading that are found in the Apthread folder:

Apthread: This folder contains two samples that illustrate the use of the apartment threading feature in the Distinct ActiveX controls (VB 6):

Multiple: This subfolder contains a sample called ThreadDemo. This sample application illustrates how to have your application do multiple concurrent get operations. To simplify this sample, it is hardcoded to connect automatically to the Distinct FTP site when the user selects Get File from the file menu and transfers a predefined test file to the screen using an event based file transfer when the user clicks on the Start Getting the File button. The user can run several of these operations concurrently, with each Get an instance of the ActiveX component is created with its own thread.

Note: this sample should be executed from outside the Visual Basic environment.

Shared: This subfolder contains a sample that is also called ThreadDemo. This sample illustrates how the methods of the ActiveX control can be shared by other threads.

Ftpclnt: This subfolder contains the FTPCLNT sample. This FTP sample program shows you how to make a connection to the FTP server, send FTP commands and close your FTP connection. It demonstrates much of the functionality of the FTP client ActiveX control, illustrating the functions as menu items to simplify the code breakdown and allow the programmer to quickly find some sample code for a particular method or property. This sample also illustrates how to connect to an FTP server through a SOCKS firewall proxy.

Get: This contains subfolders with very simple samples that illustrate an event based and file based get:

Evntmode: this subfolder contains the ftpget sample. This sample illustrates how to get a file using the event based transfer mode. An event based transfer is useful when your application needs to display the data as it receives it rather than saving it to a file.

Filemode: this subfolder contains the ftpget sample. This sample illustrates how to get a file using the a standard File based transfer mode.

Parse: This subfolder contains the ftpparse sample which illustrates how to parse directory listings on the server. This sample gets a long directory listing and parses the information. This sample does not specify the server type being connected to. This means that the default value of the HostType property (Autodetect) is used. Note that if you specifically wish to specify a host type in your application you need to do this by setting the HostType property to one of the supported values.

Put: This contains subfolders with very simple samples that illustrate an event based and file based put:

Evntmode: this subfolder contains the ftpput sample. This sample illustrates how to put a predefined file on the ftp server using the event based transfer mode. An event based transfer is useful when your application needs to save its data directly to a file as it is transferred without first creating a local file.

Filemode: this subfolder contains the ftpput sample. This sample illustrates how to put a file using the a standard File based transfer mode.

FTPSRV (FTP Server ActiveX) This ftpsrv sample program shows you how to integrate an FTP server that is capable of creating and modifying a client database, servicing several clients (up to 64) simultaneously and providing statistics on client activity. It demonstrates much of the functionality of the FTP server ActiveX control, illustrating the functions through a simple interface, user database structure and menu items to simplify the code breakdown and allow the programmer to quickly find some sample code for a particular method or property. This program illustrates how to write a custom FTP server application using the FTP Server ActiveX control.
ICMP (ICMP ActiveX) Two samples are supplied to illustrate the use of the Internet Control Message Protocol (ICMP) to illustrate how to build in diagnostic tools directly into your applications to facilitate support.

Ping: The Ping sample uses the ICMP ActiveX control to get an echo reply from a host. This is an extremely helpful tool to build in to any networking application (Internet or Intranet.)

Tracrt: The Tracert sample shows how to trace the route a packet takes to the destination host. This is very useful for diagnosing networking issues in Internet-based applications.

IMAP (IMAP ActiveX) Two samples are included in separate subfolders:

ImapClnt: This subfolder contains the ImapClnt sample that illustrates how to use the IMAP ActiveX to connect to an IMAP server through a SOCKS firewall, select and manipulate mailboxes and their contents (search, append, list, retrieve parts of a message, store or delete mail in private mail boxes) and disconnect. It demonstrates much of the functionality of the IMAP client ActiveX, illustrating the functions as menu items to simplify the code breakdown and allow the programmer to quickly find some sample code for a particular method or property. When running this sample look at the help file for instructions.

Retrieve: This subfolder includes a much simpler sample that illustrates how to use the IMAP ActiveX to connect to an IMAP server and get any new messages (VB6 only).

LMC (LMC ActiveX) This sample program shows you how to use the Distinct license manager to get and release a license. You would make use of this feature if you wanted your application to avail itself of the Distinct floating license system.
LPR (LPR ActiveX) The LPR sample application illustrates how to send print jobs to an LPD server, query for the queue status and manage the print queue.
MIME (Mime, SMTP and POP ActiveXs) This folder contains three subfolders each with a sample application:

Mime: The Mime program shows how to encode and decode files, and how to create and extract messages with attachments.

SmtpMime: The SmtpMime sample illustrates the combined use of the SMTP and MIME ActiveX controls. It illustrates how to create an SMTP plain text message and attach MIME or UUencoded files. It then emails the messages using SMTP. You need to have a valid SMTP server to run this sample.

PopMime: The SmtpMime sample illustrates the use of the Mime ActiveX in conjunction with the POP ActiveX. It shows you how to connect to a POP3 server, download and extract MIME encoded or UUencoded mail messages.

NNTP (NNTP ActiveX) The nntpclnt sample program illustrates how to access a News server using the NNTP ActiveX control. The NNTP sample shows how to read, post, position and list news articles and how to navigate news groups. It also illustrates how to connect to the remote server through a firewall proxy.
POP (POP ActiveX) The popclnt sample program shows you how to make a connection to the POP 2 or POP 3 server, send POP commands, download messages, and close your POP connection. It demonstrates much of the functionality of the POP client ActiveX control, illustrating the functions as menu items to simplify the code breakdown and allow the programmer to quickly find some sample code for a particular method or property.
RAS (RAS ActiveX - this includes SLIP/PPP support) There are two samples for this ActiveX. Note that you must have Microsoft Dialup correctly installed before running these samples:

RAS: This program illustrates how to control the dialup and hang-up process to a remote server using the RAS ActiveX control. It allows RAS, SLIP or PPP connections. This sample also shows how to do phonebook management. It illustrates all the features included in the ActiveX for the creation and updating of new phone book entries.

RasSmpl: This folder contains a simplified RAS sample that specifically shows how to dial a fixed location given a phone book entry.

RCP (RCP ActiveX) This program illustrates how to include remote copy operations into an application using the RCP ActiveX control. This sample shows how to copy files between the local and remote machine, or from one remote machine to another. It also illustrates how to do recursive file copying. The sample also allows you to create a new file and save it to a remote file as well as view the contents of a remote file.
RLIB (RLIB ActiveX) The Rcmds program illustrates how to include remote command execution into an application using the RLIB ActiveX control. The sample demonstrates the use of remote execution (Rexec), remote shell(rsh) and remote login(rlogin).

Note: In order to be able to connect using RLIB (RSHELL & REXEC) you must make the PC running RLIB client, a trusted host on the Unix machine that you are trying to connect.

Server (TCP Server ActiveX) This folder contains two sub folders one with a client application and one with a server application. They are intended to be run together to illustrate how a server application handles a client call:

Tcpclnt: This is a simple windows sockets application that makes a connection to a TCP server and sends data to the server

Tcpsrv: This is a very simple server application that can be put in listen mode to accept TCP connections and data sent from the tcpclnt application. For simplicity this sample has only two display windows and accepts two concurrent connections. You can modify the sample to accept more connections.

SMTP (SMTP ActiveX) Depending on your version of Visual Basic there are one or two samples:

Smtp: This smtpclnt sample program shows you how to make a connection (including connecting through a SOCKS firewall server) to the SMTP server, send SMTP commands and mail, and close your SMTP connection. It demonstrates much of the functionality of the SMTP client ActiveX control, illustrating the functions as menu items to simplify the code breakdown and allow the programmer to quickly find some sample code for a particular method or property.

Mail: This smtpclnt sample is a simplified sample that shows how to connect to an smtp server, send a simple text message and display the reply from the smtp server.

Telnet (Telnet ActiveX) The telnet sample program illustrates how to include Telnet type login capabilities into an application. It establishes a telnet connection (with the option of establishing this through a SOCKS firewall), allows you to send telnet commands and disconnects from the server.
TFTP (TFTP ActiveX) The tftpclnt sample program illustrates how to include TFTP file transfer functionality into an application using the TFTP ActiveX control. It demonstrates how to copy files between the local and remote machine, or from one remote machine to another.
VT220 (VT220 ActiveX) There are two samples for VT220:

VT220: The VT220 sample program illustrates how to include complete VT220 terminal emulation into an application using the VT220 ActiveX control. This sample shows how to manage and customize configurations, how to capture data from the remote terminal, and how to map the keyboard.

Socket: The socket sample program is designed to show how to filter data before it is sent to the VT220 or when it is received from the VT220. For this the Windows Sockets Control is used to handle the connection and the sending and receiving of data. This data can then be filtered when it is received from the host and before it is given to the VT220 ActiveX control. The data from the Vt220 ActiveX control can also be filtered before it is sent back to the host.

Vbdynamic (uses the Windows Sockets and FTP controls to illustrate how to create the Controls in a form dynamically) Daytime: The daytime sample program is used to illustrate how to create the Windows Sockets ActiveX control dynamically.(VB6)

Ftpclnt: This is the same ftpclnt sample found in the ftpclnt folder that has been modified to illustrate how to create the FTP ActiveX control dynamically. (VB6)

Message: These samples illustrate how to add the Windows Sockets control dynamically using different methods (VB6).

Add Message: This folder includes two samples one to send data and one to receive. Both samples show how to add a ActiveX control to a form dynamically at run time using the Controls.Add method (VB6).

ExtMessage: This folder also includes two samples one to send data and one to receive it. Both samples show how to add an ActiveX control dynamically to a form, using the VBControlExtender object. All of the events fired by the control are caught by the VBControlExtender ObjEvent event and can then be used by the application (VB6).

Vbnoui (uses the ftp control to illustrate how to use the controls with no user interface) FtpGet: This contains the GetClnt sample application which shows how to do file transfer with the FTP Client ActiveX without having any interface, and by creating the control dynamically. The other controls may also be used in this way (VB6).
Windows Sockets (Windows Sockets ActiveX) This folder contains three subfolders each containing sample code to illustrate how various operations can be achieved using the Windows Sockets ActiveX.

Daytime: This sample program illustrates how make a UDP or TCP connection to the remote host and retrieve the reply from the host. (see also the sample in the Vbdynamic folder to illustrate how the Windows Sockets control can be dynamically added to the form.)

SendRecv: This subfolder contains two subfolders, each containing a sample application. These two applications are intended to be run concurrently. They illustrate how to write both the client and the server side of a TCP connection, with acknowledgements from the server once data has been received.

Resolve: This program illustrates how to resolve a host name to an internet address, or an internet address to a host name using the Windows Sockets ActiveX control.

WhoIs (WhoIs ActiveX) This program illustrates how to include WhoIs functionality into an application.

 <<   Table Of Contents   >> 

*Get Adobe Acrobat Reader if needed.


Purchase Visual Internet Toolkit
VIT-52-FL Distinct Visual Internet Run Time - Floating License
Version 5.2 for Windows 95/98/ME/NT/2000/XP/Vista
Licensing information   License Agreement
$100.00  ORDER
VIT-52-RT Distinct Visual Internet Client Run Time
Version 5.2 for Windows 95/98/ME/NT/2000/XP/Vista
Licensing information   License Agreement
$50.00  ORDER
VIT-52-S Distinct Visual Internet Toolkit with Subscription
Version 5.2 for Windows 95/98/ME/NT/2000/XP/Vista
Licensing information   License Agreement
$895.00  ORDER
VIT-52 Distinct Visual Internet Toolkit
Version 5.2 for Windows 95/98/ME/NT/2000/XP/Vista
Licensing information   License Agreement
$595.00  ORDER
VIT-S Subscription to Distinct Visual Internet Toolkit
Renewal
$400.00  ORDER






Browse FAQ

Related Products
Mail Objects

Recommended Add-On
Network Monitor,
Protocol Analyzer


Raves
"The night before I went on summer holiday we had to make some 'last minute' configuration changes to approx. 300 routers, a tedious job to do manually with telnet. We went along with MS Excel containing a list of IP-adresses to the routers, and the VIT telnet-component. One hour later the VBA-application (small is beautiful) was working, and after another hour all of our routers were updated with the new configuration. I just say a big "Thanks" to you all for a good sleep that night."
Eirik Brendholen, Ergo Integration AS

"We conducted a test session to compare the performance of similar products, and Distinct's product was better!" [more]
Dr. Shyam Sunder, Carnegie Mellon University

"Together with Distinct, we were able to offer our users an ideal soution to enabling them to connect to Yahoo! Pager, and to do so both quickly and reliably." [more]
Brian Park,
Producer of Yahoo! Pager, Yahoo! Inc.


  02/03/2012   Legal notices | PRIVACY Policy |