Variable pointer to interface between C# and C++
<p>I am currently stuck trying to do this conversion. I have a C++ wrapper that exposes a function...</p>

<pre><code>public __gc class InternalModuleConfig : public ModuleConfig
{
Object* InternalModuleConfig::CommitChanges(IModuleConfig* config)
{
    VARIANT variant = {0};
    m_pModuleConfig = config;
    HRESULT hr = m_pModuleConfig-&gt;CommitChanges(&amp;variant);

    if (FAILED(hr))
    {
        VariantClear(&amp;variant);
        return Marshal::GetObjectForNativeVariant(&amp;variant);
    }

    return NULL;
};
};
</code></pre>

<p>I am trying to call this function in c# but failing at it. I have an interface in C# with the following namespace:</p>

<p>DirectShow.IModuleConfig</p>

<p>Now I am trying to take my existing interface and get a pointer to it to use as the variable for CommitChanges in C# however I always get an conversion error.</p>

<p>This is the barebone with what I'm trying...</p>

<pre><code>InternalModuleConfig config;
config.CommitChanges(ref (filter as IModuleConfig));
</code></pre>

<p>This does not work... I'm a bit confused as to how to apply the type IModuleConfig* for the parameter.</p>

<p>Any ideas?</p>

<p>EDIT:
This is the interface the InternalModuleConfig is based on:</p>

<pre><code>public __gc interface ModuleConfig : public IDisposable
{
public:
virtual Object* CommitChanges(IModuleConfig* config) = 0;
IModuleConfig* m_pModuleConfig;
};
</code></pre>
