title: p/invoke operation ends up with executing another function
body: <p>Not sure why this is happening, but when i execute one of my c# function, which could be defined by the following c# interface:</p>
  
  <pre><code>[ComImport, Guid("EA5435EA-AA5C-455d-BF97-5F19DC9C29AD"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IClosedCaptionsDecoder2 
  {
      [PreserveSig]
      int SetConfig([In] ref ClosedCaptionsDecoderConfig config);
      [PreserveSig]
      int GetConfig([Out] out ClosedCaptionsDecoderConfig config);
  }
  </code></pre>
  
  <p>and c++ interface:</p>
  
  <pre><code>    interface __declspec(uuid("{EA5435EA-AA5C-455d-BF97-5F19DC9C29AD}"))
      IClosedCaptionsDecoder2 : public IClosedCaptionsDecoder
      {
          STDMETHOD(SetConfig)(IN CLOSEDCAPTIONSDECODERCONFIG&amp; config) PURE;
          STDMETHOD(GetConfig)(OUT CLOSEDCAPTIONSDECODERCONFIG* pConfig) PURE;
      };
  </code></pre>
  
  <p>im redirected to another function declared by a 'prior' interface.
  when i try to execute the following command for example:
  config->SetConfig(....). the function im redirected to(or next command to execute), is implemented by the base classs of <strong>IClosedCaptionsDecoder2</strong>, which's called <strong>IClosedCaptionsDecoder</strong>.</p>
  
  <p>the c++ decleration of this interface is:</p>
  
  <pre><code>interface __declspec(uuid("{26B8D7F1-7DD8-4a59-9663-8D00C03135F7}"))
          IClosedCaptionsDecoder : public IUnknown
          {
              STDMETHOD(xxx)(IExternalCCObserver* pObserver, LONG lFlags) PURE;
          };
  </code></pre>
  
  <p>so config->SetConfig() actually invokes config->xxx(), my guess is that something is wrong with the offests of the functions.</p>
  
  <p>i even tried to define the entire relation in the c# side(the inheritance and so on) but that didn't work either.</p>
  
  <p>i would appreciate any help.
  thanks!</p>
  
  <p><strong>Edit:</strong> when i tried to call GetConfig(), it actually executed SetConfig(). so im definitly having problems with pointers offset or so. each function, calls the previous one in the decleration order, how's it possible??</p>
  
  <p><strong>Edit2</strong>: i managed to solve this case by adding all functions to the IClosedCaptionsDecoder2 interface.</p>