<div>As a C+ newbie.</div>
<div>I am tring to write the MSN add-in in C# and use IronPython (Python, my favorite) actually.</div>
<div>The following code can be compiled successfully (in VC# Studio).</div>
<div>But it fails to be imported to be Messenger Add-in.</div>
<div>The problem happens to create PythonEngine in Initialize().</div>
<div>Any Hints? </div>
<div>Thanks in advance.</div>
<div> </div>
<div>iap</div>
<div> </div>
<div>=================================================================================</div>
<div>using System;<br>using Microsoft.Messenger;<br>using IronPython.Hosting;<br>namespace MyAddIn<br>{<br> public class AddIn: IMessengerAddIn<br> {<br> MessengerClient _mclient = null;<br> public void Initialize(MessengerClient mclient){
</div>
<div> PythonEngine engine = new PythonEngine(); // If this line disabled, to be imported in Messenger will be fine.<br> _mclient = mclient;<br> _mclient.AddInProperties.FriendlyName = "My Bot 2";
<br> _mclient.AddInProperties.Creator = "My Name";<br> _mclient.AddInProperties.Description = "Bot for testing";<br> _mclient.AddInProperties.Url = new Uri(<a href="http://www.google.com">
http://www.google.com</a>);<br> _mclient.IncomingTextMessage += new EventHandler<IncomingTextMessageEventArgs>(IncomingTextMessageHandler);<br> }<br> void IncomingTextMessageHandler(object sender,IncomingTextMessageEventArgs args){
<br> _mclient.SendTextMessage("What you said:"+args.TextMessage, args.UserFrom);<br> }<br> }<br>}<br> </div>
<div> </div>