need help converting c++ definitions to c# equivalent
<p>I'm using an API (written in c++) to connect to a DVR machine, actually I only have the .dll and the .lib files, and I want to do the job in .NET (C#).
So, the API doc contains definitions to all functions inside the dll, and I'm having a hard time trying to figure out how to translate those functions to equivalente C# definitions. Some of them are straightforward, but some I cannot make it work.</p>

<p>For example, there is this function:  </p>

<pre><code>bool searchEvent(int channel, const LONG* condition, bool next)  
</code></pre>

<p>In my c# class I put the following:  </p>

<pre><code>[DllImport("search.dll")]  
protected static extern bool searchEvent(int channel,  
[MarshalAs(UnmanagedType.I8)]long condition, bool next);
</code></pre>

<p>but when I call the searchEvent function, it raises an error (memory error), I guess because of that long var. So my question is how can I translate "const LONG* condition" to c#?
Also, that searchEvent function triggers a callback that returns a struct. I am unable to translate some vars of that struct, like:  </p>

<pre><code>char _version[2]  
time_t _time  
BYTE* _minute  
unsigned short int _dwell[MAX]  
</code></pre>

<p>Can someone help me with this, please? I´m no expert in c++, so any tips are greatly appreciated. Thanks!</p>
