Help - Search - Members - Calendar
Full Version: Skype4COM Ambiguity problem in C#
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
blindfolded
Hey!

I'm using C# and Skype4COM to work on my secret little project...tongueout.png
But i've come to a point where i want to automatically know when the Attachment status changes in order to keep the connection to the API alive.
The only way i know how to do this generated the error in the topic title.
Here's what i've done:

private Skype skype = new Skype();

this.skype.AttachmentStatus += this.SkypeAttachmentStatusChanged;

where SkypeAttachmentStatusChanged is a function that should be called when the attachment status changes...
The problem seems to be the part in bold. What can i do to avoid it?

Thanks,

Have a great day

p.s. I checked the docs, but there were only VB examples.
TheUberOverlord
QUOTE(blindfolded @ Aug 23 2006, 07:23 PM) [snapback]290548[/snapback]

Hey!

I'm using C# and Skype4COM to work on my secret little project...tongueout.png
But i've come to a point where i want to automatically know when the Attachment status changes in order to keep the connection to the API alive.
The only way i know how to do this generated the error in the topic title.
Here's what i've done:

private Skype skype = new Skype();

this.skype.AttachmentStatus += this.SkypeAttachmentStatusChanged;

where SkypeAttachmentStatusChanged is a function that should be called when the attachment status changes...
The problem seems to be the part in bold. What can i do to avoid it?

Thanks,

Have a great day

p.s. I checked the docs, but there were only VB examples.


Please see this is is written in JavaScript and it Speaks Skype4COM events and you can use it to see how to recover from status changes:

http://testing.onlytherightanswers.com/mod...icle&sid=52
blindfolded
QUOTE(TheUberOverlord @ Aug 24 2006, 02:00 AM) [snapback]290550[/snapback]

Please see this is is written in JavaScript and it Speaks Skype4COM events and you can use it to see how to recover from status changes:

http://testing.onlytherightanswers.com/mod...icle&sid=52


Thanks for coming in my help. smile.png
I see how you did the events in the js example. But my problem is adding the event in c#.
The problem seems to be that ISkype and _ISkypeEvents_Event have both a method with the same name: AttachmentStatus.

my skype object is created like this: private Skype skype = new Skype();
Going a little deeper i found this definition for "Skype"
CODE
using System.Runtime.InteropServices;
namespace SKYPE4COMLib { [CoClass(typeof(SkypeClass))] [Guid("B1878BFE-53D3-402E-8C86-190B19AF70D5")]
public interface Skype : ISkype, _ISkypeEvents_Event { } }


That would explain the "ambiguity" part.

I also went to _ISkypeEvents_Event definition and found out that indeed the event that i want to use is define here:
CODE
event _ISkypeEvents_AttachmentStatusEventHandler AttachmentStatus


Now my problem is that i don't know how to specify which one's method i'm reffering to when i do the
CODE
this.skype.AttachmentStatus += this.SkypeAttachmentStatusChanged;


I was able to use the Call status event below (as found in one of the examples on developer section)
CODE
Skype skype = new Skype();
skype.CallStatus += this.SkypeCallStatusChanged

but this was possbile only because the two interfaces DO NOT share this "CallStatus" method name. Therefore it went straight for the _ISkypeEvents_Event one, and no ambiguity had taken place.

So, all i need is to be able to differentiate between the two interfaces.

Any ideas?
Thanks in advance,
Cristian
andreskaasik
I had the same problem and found a workaround with SkypeClass.

CODE
SkypeClass oSkype= new SkypeClass();
...
oSkype._ISkypeEvents_Event_AttachmentStatus += new _ISkypeEvents_AttachmentStatusEventHandler(OnAttachmentStatus);

blindfolded
Thanks a lot!

I will try this when i get home smile.png

Cheers!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.