PictureTel Application Note #3: Using NetMeetingTM with the Live200 April 1998

Overview

Requirements Considerations ActiveX Implementation COM Object Implementation

Overview

This document discusses integration issues related to the use of Microsoft NetMeeting with the PictureTel Live Developer's ToolKit (LiveDTK 2.1) and the Live200 product.

In a standard videoconference call using the Live200 application, audio and video are transmitted over an ISDN, V.35, or switched-56 connection. Once a connection is established, the same line can also be used to transmit other kinds of data. For instance, in the Live200 version 1.5 for , PictureTel's LiveShare Plus software provided standard data conferencing applications such as Whiteboard, Application Sharing, and File Transfer.

Starting with the Live200 version 1.1 for Windows NT, Microsoft NetMeeting can now take the place of LiveShare Plus in providing data conferencing over the connection provided by the PictureTel audio/video conference. Or, NetMeeting can be run simultaneously over a different transport such as TCP/IP, while the audio/video call proceeds over ISDN.

For toolkit developers, this means using the NetMeeting SDK for any data conferencing oriented functions. If you have previously implemented these functions using the LiveShare Plus custom control that ships with the PictureTel LiveDTK, then you will be interested in the wrapper control that we have put together. Please refer to the Manager.DLL Reference Guide document elsewhere on this web site. If you have not been using the LiveShare Plus control, then you may want to move straight to the NetMeeting SDK. There are two flavors, a NetMeeting ActiveX control and a NetMeeting COM object. This document discusses each approach, and then shows how to use each one in conjunction with the PictureTel LiveDTK functions.

Requirements

To utilize Microsoft NetMeeting with the PictureTel Live200 from within your customized application, you need to be running one of the following configurations:

On Windows NT:

• Live200 1.1 for Windows NT - Driver Software • Live200 1.1 for Windows NT - Application Software • LiveDTK 2.1 • Microsoft NetMeeting 2.1

Considerations

Usage of the NetMeeting functions is fairly straightforward, but there are some considerations you should be aware of before you decide how to implement your application. The following tables show some pros and cons regarding the two NetMeeting implementation options available.

Note: This is PictureTel’s opinion only; please contact Microsoft for additional information.

NetMeeting ActiveX Control

PROS CONS

• Can be used with any ActiveX Scripting • Does not provide advanced control for the language, e.g., Visual Basic. behavior of NetMeeting.

• Cannot control the appearance of the • Provides basic functionality for operations NetMeeting user interface which is always using the NetMeeting user interface. present.

• Easy to use; requires a small amount of • Availability of only one sample program code to implement. using this control.

In general, if you need the basic functionality, use the ActiveX control, but if you prefer to have more control, you will need to develop your applications using C++ or another language that can utilize the COM object.

NetMeeting COM Object

PROS CONS

• Allows maximum control over the • Cannot use directly in any scripting NetMeeting application. language.

• Provides the events and methods to control • Cannot use MFC with the samples that are almost all the NetMeeting interfaces. coded strictly in C++ .

• Simple interface design makes it easy.

• Provides control of the appearance of the

NetMeeting user interface.

• Sample programs available from

Microsoft.

ActiveX Implementation

To use the NetMeeting ActiveX control with a LiveDTK application, please follow this procedure:

1. Add MSCONF.OCX to the toolbox. If you are using Visual Basic, you will see a new icon in the

toolbox (ActiveX Conference). 2. Add this control to the project, ActiveXConference1. 3. Declare this in your global declarations in order to register the application with NetMeeting.

Const AppID As String = Dim Conference As IConferenceX 'You will need this in order to monitor the conference Dim m_bIncoming as Boolean 'This is to check whether the call is incoming or outgoing

4. Put the following code in your main form.

Private Sub Form_Load() ...... 'This is used to initialize NetMeeting ActiveXConference1.Initialize AppID ActiveXConference1.Advise ...... End Sub Private Sub Form_Unload(Cancel As Integer) ActiveXConference1.Unadvise End Sub

5. Put the following code in the CallConnected event of the Call Interface Control (assuming you already have CallInterface in your project and it has been put on the form).

Private Sub CallIntf1_CallConnected(ByVal hConnection As Long) Dim User As IConfUserX ' This is set from the CallIntf1_ConnectionCreate event If (m_bIncoming = True) Then ' If the call is incoming, the conference is created by the remote end.

' We will be asked to join, so do not need to do anything. Exit Sub End If

On Error Resume Next Dim Conferences As IConferences Set Conference = Nothing Set Conferences = ActiveXConference1.Conferences If Not (Conferences Is Nothing) Then ' Get the first conference Set Conference = Conferences(0) If Not (Conference Is Nothing) Then Conference.Advise End If End If ' Create the conference on your end. Any conference name will do. If Conference Is Nothing Then Set Conference = ActiveXConference1.CreateConference("PictureTel", CNF_CAPS_DATA) If Conference Is Nothing Then MsgBox "Failed to create conference." Exit Sub End If

Conference.Advise End If

' Create the user. It has to be always "LIVE:Data" Set User = ActiveXConference1.CreateUser("LIVE:Data", CNF_USER_UNKNOWN) If User Is Nothing Then MsgBox "Failed to create user." Else If Not Conference.Invite(User) Then 'Invite the user to the conference MsgBox "Failed to invite user." End If End If End Sub

6. Add this code to the ConnectionCreate event of your CallInterface control.

Private Sub CallIntf1_ConnectionCreate(ByVal hConnection As Long, ByVal netType As Integer,

ByVal callType As Integer, ByVal pAddress As String, ByVal pName As String, ByVal isIncoming As Boolean) m_bIncoming = isIncoming ' This is to decide whether we should create the NM Conference or not End Sub

7. Add the following code to the ConferenceCreated event of your ActiveX Conference control in order to monitor Conferences.

Private Sub ActiveXConference1_ConferenceCreated(ByVal pConference As ActiveXConferenceCtl.IConferenceX) Set Conference = pConference Conference.Advise End Sub

8. Now you can handle the NetMeeting ActiveX Conference events to do the necessary initialization. Please see the VBCARD sample that comes with the NetMeeting SDK for how to handle channels.

9. Visual C++ users can follow this same procedure to use the NetMeeting Conference control with their LiveDTK application.

COM Object Implementation

To use the NetMeeting COM object with a LiveDTK application, please follow this procedure:

Note: This assumes that you are using Microsoft Visual C++ 5.0.

1. To use NetMeeting COM object, you need to add imsconf2.idl to your project, and set the Custom Build setting as follows:

midl /client none / none /ms_ext /W1 /c_ext /env win32 /Oicf /dlldata $(TargetDir)\dlldata.rpc /proxy $(TargetDir)\$(inputname).rpc /header $(inputname).h /iid $(inputname).c (InputPath)

2. Create the INmManager Interface using CoCreateInstance.

hr = CoCreateInstance (CLSID_NmManager, NULL, CLSCTX_INPROC, IID_INmManager, (void **)&m_nmManager); // Here m_nmManager is INmManager * and CLSID and IIDs are in imsconf2.h

3. Create a sink to the INmManagerNotify interface to get the events from the manager.

m_nmMgrSink = new CNmMgr; // create a new sink for the events. hr = m_nmMgrSink -Connect (m_nmManager); // Here, CNmMgr is // class CNmMgr : public CAddRef,public CNotify,public INmManagerNotify // See the NMUI sample for explanation about CNotify class. // CAddRef - maintains the Reference count // CNotify - does the enumeration of connection points and finds the right connection // point to connect to.

4. Initialize the manager using INmManager::Initialize method.

ULONG uCaps = NMCH_ALL; // for all values see the NetMeeting INmManager help ULONG uOptions = NM_INIT_CONTROL ; hr = m_nmManager-Initialize (&uOptions, &uCaps);

5. In CallConnected event of Call Interface call.

void CNMTestView::OnCallConnected (LONG) { // Handle the incoming CallConnected by using the isIncoming flag from // ConnectionCreate Event. if (m_nmManager == NULL) { return; } // Now we have someone who can talk names. CComBSTR strAddr ("LIVE:Data"); HRESULT hr = m_nmManager-CreateCall (NULL, NM_CALL_T120, NM_ADDR_UNKNOWN, strAddr, NULL); if (hr) { printf ("Could not place the call to ASYNC:Pictel. hr = %s\n",GetErrSz (hr)); } }

6. After this you will be receiving events that you need to handle to connect to the right channels. See the NMUI sample with NetMeeting 2.1 SDK to know how to hook to channels. In particular take a look at HookChannel () function in NMUI. 7. If it is an incoming call, you will be receiving a CallCreated event from INmManagerNotify. The NMUI sample deals with this cleanly.

8. You will need to use the Accept method when you receive a Call notification as NM_CALL_RING in order to connect to the incoming call.

9. In order to create the Data channel, do the following:

When you receive INmConferenceNotify::StateChanged as NM_CONFERENCE_ACTIVE , create the data channel using INmConference::CreateDataChannel( ) with REFGUID = g_guidNM2Chat where const GUID g_guidNM2Chat = { 0x340f3a60, 0x7067, 0x11d0, { 0xa0, 0x41, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } } To create a Chat channel. You can use other IDs to create your own data channels.

When you receive a INmConferenceNotify::ChannelChanged() event, the uNotify = NM_CHANNEL_ADDED, hook to the channel. If INmChannel - GetNmch () returns NMCH_DATA, you need to hook up data here. See HookData () function in NMUI for details.

Copyright © 1998, PictureTel Corporation. All rights reserved.