Using C++ DLL (pointer method) in C#
<p>I have a C++ DLL file, I need to use it's function from C#. C++ file have a method called "Status" in ServiceState. C++ code for that block is given below.</p>

<pre><code>STDMETHODIMP ServiceState::Status(/*[out]*/VARIANT *Primary,VARIANT *Secondary ) 
{
if(primary()) 
     Primary-&gt;boolVal = TRUE;
else
     Secondary-&gt;boolVal = FALSE;

return true;

}
</code></pre>

<p>I compiled the C++ project and got the <strong>Status.dll</strong> output. 
I initialized in C# code as follow.</p>

<pre><code> [DllImport(@"c:\Status.dll")]
 public static extern void ServiceState.Status(IntPtr Primary,IntPtr Secondary);
</code></pre>

<p>1) Whether the Initialization is correct?</p>

<p>2) As the method have pointers in C++, what C# data type have to be passed to that method &amp; how? Please guide me. </p>

<p>Thanks</p>
