VcCom Logo
 VcCom Ltd

 

Using VcCom API

VcCom API has a COM interface as well as example applications (VC++, VB 6.0, VB .net) for both the Server and Client which you can use to see if VcCom API is working and also use as an example of how you could include VcCom API within your own applications.

The VcCom API interface, example applications as well as the example code is explained below.

How To Install VcCom API

VcCom API is supplied with a set of installers for Citrix and a set of installers for Windows Terminal Servers (for Remote Desktop Connection clients) . Both the Citrix and Terminal Server version of VcCom API installs can be installed on the same Server and Client PCs.

All of the installers, example projects and code may be downloaded from this site (see downloads). 

Server Installs

You will need to install the server part of VcCom API by using the "Add or Remove Programs" within the control panel of your server. Use the "Add New Programs" option to select the VcCom API Server installer (either VcComCtxSrv.exe or VcComTSSrv.exe)  to start the installation.

The install may request that you reboot the server once it is complete. 

If you have purchased a license key for VcCom API, use the VcCom API license application installed on the server to enter your license key. 

Client Installs

You will need to install a copy of the VcCom API Client on each Client PC that you want to be able to use VcCom API from.

Make sure the client software that will be used to access the server is installed first (i.e. Citrix ICA Client). Run the VcCom API Client installer (either VcComCtxCli.exe or VcComTSCli.exe) and follow the instructions.

The install may request that you reboot the PC once it is complete. 

Once the VcCom API client is installed, you will need to restart any client sessions you have open with the server before the VcCom API client software will start to work.

Example Applications

By default, two of example applications are installed on the Server and Client PCs by the installers. A third example is available to be downloaded.  These example applications can be found in the C:\Program Files\VcCom API directory or downloaded from this web site, Shortcuts are NOT created to these example applications.

The example applications (the source code is available to be downloaded) are:

VBClient.exe Sends messages over channel 1 of VcCom to any other application that connects to channel 1. This can be used to send test messages to your own applications.
VBClient2.exe Sends messages over channel 2 of VcCom to any other application that connects to channel 2. This can be used to send test messages to your own applications.
VBClient3.exe Citrix only - Sends command messages from the server to the client that are executed on the client in the same way as Start/Run.

To use these applications, publish the applications on the server (if using Citrix) or start them from the Desktop on the server, start the corresponding application on the client PC.

Use the Connect button on each application to hook them into VcCom. Hitting the send button on any of the applications will send a message to the other application which will be displayed to you on the screen.

How to use VBClient3 example (the command channel)

1) Click the "Connect" button to connect the application to VcCom
2) Type a command in to send and then hit "Send Command"

In order to work out the commands you wish to send, a good place to start is have a look at the Start\Run command. Everything you can run from that point on the client can be sent to the client via the VcCom command channel.

Therefore to open a web page, just send the URL to the web page. e.g., www.vccom.net

To open excel, send:

excel
or
the path the the xls file you want to open.

Or have a look at the following website:

http://www.commandwindows.com/runline.htm (Vic Laurie, 2010)

COM Interface

The COM interface is very simple, it has three methods to send messages to other applications and one method that you implement that receives the message:

VB Projects

This is very simple to use, the messages you send and receive is up to you. 

Include within your project references "VcCom 1.0 Type Library" 

Declare a VCCOMLib.VcComSession

Private WithEvents m_session As VCCOMLib.VcComSession

Connect to VcCom

Set m_session = New VCCOMLib.VcComSession

Send a message into VcCom (all other applications in the user session that is also connected will receive the message)

m_session.SendToAll "the message you want to send"

Create a function to receive your own messages in your application

Private Sub m_session_VcComReceive(ByVal name As String, ByVal Id As String, ByVal message As String)

Disconnect from VcCom when closing your application

Set m_session = Nothing

Note * This code connects to channel 1 within VcCom (add a call to "m_session.channel = 1" to change between 1 and 2 VcCom API channel, note that setting channel to 0 will use channel 1 and setting channel to 1 will use channel 2).

An example VB 6.0 and a VB .Net project with the code can be downloaded from the downloads  page. Note that you should install VcCom onto your development machine (Citrix or Terminal Server version) before trying to build the example applications.