[JDEV] Problems using JabberCOM in C#

Jonathan Pobst jpobst at utk.edu
Tue Apr 23 14:55:53 CDT 2002


I never could get it to work in .NET either, and have switched to the
WrapJabberNet method.

It works well, but you might as well go ahead and add the source code
projects (wrapjabbernet and jabbernet) to your solution cause you're gonna
find some errors and probably will need to add some features you need.

It's very simple code to modify (to me at least), and I use VB.NET instead
of C#.NET.


pobst




-----Original Message-----
From: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org]On Behalf Of
lars at eid.as
Sent: Saturday, April 20, 2002 3:34 PM
To: jdev at jabber.org
Cc: robert.temple at dig.com; nphelps at solarc.com; vijay.tewari at INTEL.COM;
neilferguson at mail.com
Subject: [JDEV] Problems using JabberCOM in C#


Hi all!

I'm having problems using JabberCOM (http://jabbercom.sourceforge.net)
with C# and after a little search on the internet, did I find that
I wasn't the only one having such problems. For some reason is an
error produced when trying to add a second event. This may be a bug
related to using JabberCOM in .NET, meaning that a workaround might be
hard to find. But hopefully has someone been able to find a solution..

I ran JabberCOM.dll through the tlbimp.exe tool and added it as a
reference in c#.
The source code I used is as follows:
- - -
using JabberCOM;

JabberSession js = new JabberSession();

js.OnConnect += new
IJabberSessionEvents_OnConnectEventHandler(js_OnConnect);
js.OnAuthError += new IJabberSessionEvents_OnAuthErrorEventHandler
(js_OnAuthError);

js.Server = "jabber.com";
js.Username = "user";
js.Password = "pass";
js.Resource = "work";
js.Priority = 0;
js.DoConnect (false, 0);

protected void js_OnConnect()
{
	richTextBox1.Text = "Connected!";
}

protected void js_OnAuthError(string e)
{
	richTextBox1.Text = "Auth Error! : " + e;
}
- - -

Everything works fine with only one event, I start the application and
shortly after does the text change to "Connected!" in my richTextBox.
But when I add the second event, js.OnAuthError, this error is
produced:
Unhandled Exception: System.Runtime.InteropServices.COMException
(0x80040202): Exception from HRESULT: 0x80040202.


So have anyone found a solution to the second event problem?
Or have any idea on how to solve this issue?

It would be really nice to be able to use the JabberCOM object,
but I have found some alternative solutions if that doesn't work out:

This example doesn't use any object to handle the communication with the
Jabber
server, but use just c# to connect to the server. Would mean a lot of
extra work to do everything from scratch, so I'll rather avoid that.
http://www.dotnetremoting.cc/projects

So this looks much more promissing, and would maybe be the best choice for
c# developers anyway.
http://nureality.myip.org/downloads.php
(WrapJabberNET is a wrapper class of Joe Hildebrand's Jabber.NET library
http://sourceforge.net/projects/jabber-net, which is a Jabber library for
the .NET framework. It allows an easy interface for client developers.)


Regards,
Lars
_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev




More information about the JDev mailing list