You are here: MessengerYouLike.IMSDK > Using IMSDK Within Visual Studio .NET > Adding A Component As A Reference Within Visual Studio .NET 2005
MessengerYouLike
Adding A Component As A Reference Within Visual Studio .NET 2005

When using Visual Studio .NET 2005, IMSDK can be added as a reference.

 

 

The following steps illustrate how to add a component as a reference within Visual Studio .NET 2005 

 

To add the a component as a reference within Visual Studio .NET 2005

 

 

  1. Create a project as described in Creating A Project.

 

 

  1. Add the IMSDK component as a reference. To do this right-click the References folder in the Solution Explorer and choose Add Reference (see the screen shot below). If the Solution Explorer is not visible, navigate to the View menu and choose Solution Explorer.

 

 

  1. Create an instance of the IMClient component

 

[Visual Basic]
Dim WithEvents IMC As New MessengerYouLike.IMSDK.IMClient

 

 

 

 

  1. Add the following code to the Form load event handler.

 

[Visual Basic]

'Set the Port on which MessengerYouLike Will listen
   IMC.PortToListen = 20145

'Let the Messenger listen ,this should be called before any sub
   IMC.Listen()

 

 

 

 

  1. When IMClient Starts Listening it will raise an event.

 

[Visual Basic]
    Private Sub IMC_OnListening(ByVal IP As System.Net.IPAddress, ByVal Port As Integer) Handles IMC.OnListening
       Debug.WriteLine("IMClient Listening on :" & IP.ToString & ":" & Port, True)
    End Sub

 

 

 

  1. Navigate to the Debug menu and choose Start or press F5. The application will compile and execute. the Application will start listening and the event OnListening will be fired.
Copyright (c) 2007. All rights reserved.