title: Virtual function pointer to a function in a derived class
body: <p>I'm trying to see if the following is possible. I'm still on an old Visual Studio 2008 C++ compiler, so bear with me.</p>
  
  <p>Say, I have two classes derived from a single class. Both have the same function that I want to pass as a pointer to be called from a static function.</p>
  
  <p>Here's pseudocode:</p>
  
  <pre><code>class CDlg1 : public CDialog
  {
      virtual void func1(int v)
      {
          wprintf(L"CDlg1::func1 was called, v=%d\n", v);
      }
  
      void do_delayed_call()
      {
          delayed_call_func1(func1);
      }
  }
  
  class CDlg2 : public CDialog
  {
      virtual void func1(int v)
      {
          wprintf(L"CDlg2::func1 was called, v=%d\n", v);
      }
  
      void do_delayed_call()
      {
          delayed_call_func1(func1);
      }
  }
  
  
  
  static void delayed_call_func1(void* pfn)
  {
      //... some additional action
      //int v = something
  
      //Call pfn() after a delay
      pfn(v);
  }
  </code></pre>
  
  <p>I can't figure out, do I need to template for this function pointer?</p>