Skip to content

Instantly share code, notes, and snippets.

@shamun
Created July 20, 2010 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shamun/483496 to your computer and use it in GitHub Desktop.
Save shamun/483496 to your computer and use it in GitHub Desktop.
Error 1 Interop type 'SKYPE4COMLib.SkypeClass' cannot be embedded. Use the applicable interface instead. C:\Documents and Settings\test\Local Settings\Application Data\Temporary Projects\ClassLibrary1\Class1.cs 11 17 ClassLibrary1
Error 2 Interop type 'SKYPE4COMLib.SkypeClass' cannot be embedded. Use the applicable interface instead. C:\Documents and Settings\test\Local Settings\Application Data\Temporary Projects\ClassLibrary1\Class1.cs 15 26 ClassLibrary1
CODE:
=====
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SKYPE4COMLib;
namespace Example
{
class SkypeExample
{
private SkypeClass _skype;
public SkypeExample()
{
_skype = new SkypeClass();
_skype.MessageStatus += OnMessage;
_skype._ISkypeEvents_Event_AttachmentStatus += OnAttach;
_skype.Attach(7, false);
}
private void OnAttach(TAttachmentStatus status)
{
// this app was successfully attached to skype
}
private void OnMessage(ChatMessage pmessage, TChatMessageStatus status)
{
// dont do anything if the message is not received (i.e. we are sending a emssage)
if (status != TChatMessageStatus.cmsReceived)
return;
// simple echo service.
_skype.get_Chat(pmessage.ChatName).SendMessage(pmessage.Body);
}
public bool MakeFriend(string handle)
{
for (int i = 1; i <= _skype.Friends.Count; i++)
{
if (_skype.Friends[i].Handle == handle)
return true;
}
UserCollection collection = _skype.SearchForUsers(handle);
if (collection.Count >= 1)
collection[1].BuddyStatus = TBuddyStatus.budPendingAuthorization;
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment