#include <iostream>
using namespace std;

struct IDelegate
{
	~IDelegate() {}
	virtual void UpdateDisplay(int) = 0;
};

class Display
{
private:
   IDelegate* m_pDelegate;
public:
   Display( IDelegate* pDelegate = NULL)
    : m_pDelegate( pDelegate )
   {
   }

   void MyFunc(int iSel)
   {
       if(m_pDelegate)
           if(rand() & 1) //assume
               m_pDelegate->UpdateDisplay(iSel);
   }
}; 

///////

class PlaneDlg : public IDelegate
{
private:
   Display m_display;
public:
   PlaneDlg () : m_display ( this )
   {
   }

   void UpdateDisplay(int iGrp)
   {
        // do something..
   }
};

int main() {
	// your code goes here
	return 0;
}