error handleing conflict between phidgets and tcp listener

Supporting Visual Studio on Windows
Griff_en
Fresh meat
Posts: 3
Joined: Tue Feb 15, 2011 10:51 am
Contact:

error handleing conflict between phidgets and tcp listener

Postby Griff_en » Tue Jul 03, 2012 5:59 am

I modified the code of the simple led example to take data over the net using a tcp listener

There appears to be a conflict between the phidgets library and the IO library with the following errors

Error 2 No overload for 'led_Error' matches delegate 'System.IO.ErrorEventHandler'

Error 1 'ErrorEventHandler' is an ambiguous reference between 'System.IO.ErrorEventHandler' and 'Phidgets.Events.ErrorEventHandler'

Error 3 'ErrorEventArgs' is an ambiguous reference between 'System.IO.ErrorEventArgs' and 'Phidgets.Events.ErrorEventArgs'

If I comment out the " led.Error += new ErrorEventHandler(led_Error);"

and
static void led_Error(object sender, ErrorEventArgs e)
{
Console.WriteLine(e.Description);
}

the program works well and does what its meant to do

However obviously not handling phidgets errors is not a satisfactory solution
any suggestions on a workaround for the conflict .. ? or is there something simple Ive overlooked?

Regards Griff

User avatar
Patrick
Lead Developer
Posts: 3155
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: error handleing conflict between phidgets and tcp listen

Postby Patrick » Tue Jul 03, 2012 9:13 am

Since System.IO has an ErrorEvent, you need to specify the full namespace for the phidgets ones - it Phidgets.Events.ErrorEventHandler and Phidget.Events.ErrorEventArgs.

-Patrick

Griff_en
Fresh meat
Posts: 3
Joined: Tue Feb 15, 2011 10:51 am
Contact:

Re: error handleing conflict between phidgets and tcp listen

Postby Griff_en » Tue Jul 03, 2012 11:51 pm

Thanks Patrick .. yes I did overlook something simple .. much appreciated.


Return to “C#.NET”

Who is online

Users browsing this forum: No registered users and 1 guest