title: Passing non static delegate property function as parameter in C++ / CLI
body: <p>I make a interface class in C++ for voice recognition, i´m using the Julius API. <a href="http://julius.sourceforge.jp/en_index.php?q=index-en.html" rel="nofollow">http://julius.sourceforge.jp/en_index.php?q=index-en.html</a>.</p>
  
  <p>Well, my class has some events, these events will be triggered by the Julius API.
  The Julius API has the function call callback_add with this signature:</p>
  
  <p><code>int callback_add (Recog *recog, int code, void(*func)(Recog *recog, void *data), void data)</code></p>
  
  <p>I using some 'proxy' functions to Invoke the events and passing this functions to callback_add.</p>
  
  <p>If the property event is static, it works fine, but if is a non static, inside the proxy function the property not be recognized.</p>
  
  <p>The difficult is because I have to use the callback_add function and can't modify this.</p>
  
  <p>Here is a summary of the class with 2 events (static and non-static)</p>
  
  <p><strong>Header</strong></p>
  
  <pre><code>#ifndef FALAENGINE_H_
  #define FALAENGINE_H_
  
  #pragma once
  
  extern "C"{
  #include &lt;julius/julius.h&gt;
  }
  
  namespace FalaAPI {
  
      public ref class FalaEngine
      {
      public:
          FalaEngine();
          ~FalaEngine();
  
          // Events
          delegate void OnRecognizedDele(FalaAPI::RecoResult^ result);
          static property OnRecognizedDele^ OnRecognized;
  
          delegate void OnEngineStartDele();
          property OnEngineStartDele^ OnEngineStart;
  
      private:
          Recog *recog;
          Jconf *jconf;
      };
  }
  
  #endif /* FALAENGINE_H_*/
  </code></pre>
  
  <p><strong>Source</strong></p>
  
  <pre><code>#include "stdafx.h"
  
  using System::String;
  using System::Console;
  
  #include "FalaEngine.h"
  #include &lt;windows.h&gt;
  
  namespace FalaAPI{
      void StartOnEngineStart()(Recog *recog, void * dummy){
          if(FalaEngine::OnEngineStart-&gt;GetInvocationList()-&gt;Length &gt; 0)
              FalaEngine::OnEngineStart-&gt;Invoke();
      }
  
      void StartOnRecognized()(Recog *recog, void * dummy){
          if(FalaEngine::OnRecognized-&gt;GetInvocationList()-&gt;Length &gt; 0)
              FalaEngine::OnRecognized-&gt;Invoke();
      }
  
      FalaEngine::FalaEngine(){
          recog = j_recog_new();
          jconf = j_jconf_new();
  
          //Julius callback Functions
          callback_add(recog, CALLBACK_EVENT_PROCESS_ONLINE, StartOnEngineStart, NULL);
  
          callback_add(recog, CALLBACK_RESULT, StartOnRecognized, NULL);
      }
  }
  </code></pre>
  
  <p>The problem occurs inside StartOnEngineStart function:</p>
  
  <p>error C2227: left of '->GetInvocationList' must point to class/struct/union/generic type</p>