As a C+ newbie.
I am tring to write the MSN add-in in C# and use IronPython (Python, my
favorite) actually.
The following code can be compiled successfully (in VC# Studio).
But it fails to be imported to be Messenger Add-in.
The problem happens to create PythonEngine in Initialize().
Any Hints?
Thanks in advance.

iap

=================================================================================
using System;
using Microsoft.Messenger;
using IronPython.Hosting;
namespace MyAddIn
{
   public class AddIn: IMessengerAddIn
   {
       MessengerClient _mclient = null;
       public void Initialize(MessengerClient mclient){
           PythonEngine engine = new PythonEngine(); // If this line
disabled, to be imported in Messenger will be fine.
           _mclient = mclient;
           _mclient.AddInProperties.FriendlyName = "My Bot 2";
           _mclient.AddInProperties.Creator = "My Name";
           _mclient.AddInProperties.Description = "Bot for testing";
           _mclient.AddInProperties.Url = new Uri(http://www.google.com);
           _mclient.IncomingTextMessage += new
EventHandler<IncomingTextMessageEventArgs>(IncomingTextMessageHandler);
       }
       void IncomingTextMessageHandler(object
sender,IncomingTextMessageEventArgs args){
           _mclient.SendTextMessage("What you said:"+args.TextMessage,
args.UserFrom);
       }
   }
}
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to