I’m trying to make use of SKYPE4COMLib.dll.
I’ve got past referencing the library (huh), and now I’m trying to create an instance of skype:
Skype s=new SkypeClass();
I’m getting following errors:
The type 'SKYPE4COMLib.SkypeClass' has no constructors defined
and
Interop type 'SKYPE4COMLib.SkypeClass' cannot be embedded. Use the applicable interface instead.
The samples I’ve seen are in VB, and they use
Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")
which I don’t know how to translate.
Also, I’ve found following question, which seems related, but the answer doesn’t seem to be applicable to c#.
How do I create the Skype class in c#?
Quite simply it is just
Even though
Skypeis technically a interface you can still callnewon it due to it being a COM interface, that is how C# com interop works.The way to tell is by going to the “go to definition” tab for the Skype class, it should look like this.
That
CoClass(typeof(SkypeClass))is what lets you callnewon the interface.