Add-In API: Events not firing

Hello

I'm putting together a skeleton Add-In using the MessengerClient API, which is simple enough. But once I get it up and running, none of the events are firing with the exception of ShowOptionsDialog.

The code I'm using:

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Microsoft.Messenger;

namespace MsnAddin
{
public class MyAddIn: IMessengerAddIn
{
private MessengerClient _client;

public void Initialize(MessengerClient messenger)
{
_client = messenger;
_client.AddInProperties.FriendlyName = "MyAddin";
_client.IncomingTextMessage += new EventHandler<IncomingTextMessageEventArgs>(this.OnIncomingMessage);
_client.StatusChanged += new EventHandler<StatusChangedEventArgs>(this.OnStatusChanged);
_client.ShowOptionsDialog += new EventHandler(this.OnSettings);
}

public void OnIncomingMessage(object sender, IncomingTextMessageEventArgs args)
{
MessageBox.Show("Incoming Message");
}

void OnStatusChanged(object sender, StatusChangedEventArgs e)
{
if (e.User.FriendlyName == _client.LocalUser.FriendlyName) ;
MessageBox.Show("Status Change");
}

void OnSettings(object sender, EventArgs e)
{
MessageBox.Show("Configuration");
}
}
}

Once running, the "Settings..." button in the Options dialog box launches the message box as expected. But the other events never fire under expected circumstances.

I get the same result on two different machines. I must be missing something...any ideas

I'm using .NET framework 2.0 and Messenger Liv 8.0 build 8.0.0812.00.

Thanks in advance




Answer this question

Add-In API: Events not firing

  • raghu_grdr

    Oh, right...didn't see that.

    Works now..thanks much



  • Ayooya

    Great to see you writing an addin. Make sure that the addin gets activated. you can either set it to activate when your status changes by the checkbox in the addins optios page, or you can manually turn on the addin from the main window where you also change your status (it will be at the botton of the drop down)

    let us know if this works for you

  • Add-In API: Events not firing