# SkypeKit Class Methods

Remote method calls into SkypeKit runtime are synchronous and blocking. Where there are strong cases for asynchronous responses to method calls (search for contacts all over the p2p network) the implementation is such that results get returned as individual events rather than in method return arguments.

While introducing your own methods into descendants of SkypeKit classes, you will sooner or later run into cases where you will want to call your own method of an object that was given to you as a reference. You cannot simply do a typecast on a reference to gain access to methods or properties that were not present in the original SkypeKit class. To get around this, you can use the DRef typedef like this: DRef<MyClass, SkypeKitClass>(SkypeKitClassRef)->MyClassMethod().

Example: You have derived a MyConversation class from Conversation and introduced a MyConversationMethod. You then want to call that method from within Skype::OnConversationListChange callback, where the MyConversation object comes from its conversation argument - which is a ConversationRef. To gain access to your method, you can write something like this:

    class MyConversation : public Conversation
    {
    public:
        typedef DRef<MyConversation, Conversation> Ref;
        MyConversation(unsigned int oid, SERootObject* root);
        ~MyConversation() {};
        MyConversationMethod();
    };

    void MyConversation::MyConversationMethod()
    {
        printf("MyMethod.\n");
    };

    void MySkype::OnConversationListChange(
            const ConversationRef &conversation,
            const Conversation::LIST_TYPE &type,
            const bool &added)
    {
        DRef<MyConversation, Conversation>(conversation)->MyConversationMethod();
    };

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

(c) Skype Technologies S.A. Confidential/Proprietary

Last updated: Fri Jan 27 2012