Showing posts with label SkypeKit. Show all posts
Showing posts with label SkypeKit. Show all posts

Monday, May 28, 2012

Interface based programming in C++

This is a small example of the interface I had designed for exposing SkypeKit functions in a DLL .
In the below sample,  only the interface ISkypeClientLib is being exported.

// This interface is exported from the DLL
   1: class SKYPECLIENTLIB_API ISkypeClientLib
   2: {
   3: public:
   4:     virtual bool Connect(char* strAccountUID,char* strAccountPWD) = 0;
   5:     virtual void LogOut() = 0;
   6: };
   7:  
   8: // Forward declaration
   9: class CSkype;
  10:  
  11: class CSkypeClientLib: public ISkypeClientLib
  12: {
  13:     public:
  14:         CSkypeClientLib(void);
  15:         virtual bool Connect(char* strAccountUID,char* strAccountPWD);
  16:         virtual void LogOut();
  17:   
  18:     private :
  19:         CSkype *pSkype ;
  20: // more code
  21:  
  22: }
  23: