Using C++ unmanaged dll in C#
<p>I'm trying to access the functions in a C++ unmanaged dll and I'm struggling to get any results.  Here is what I have far:</p>

<pre><code>static unsafe void Main(string[] args)
    {
        IntPtr testIntPtr = aaeonAPIOpen(0);

        var DevID = aaeonWdtGetDevID(testIntPtr);

        Console.WriteLine("DevID: " + DevID.ToString()); //Does not work

        byte pbData1 = 0;
        byte pbData2 = 0;

        Console.WriteLine("Before: {0} {1}", pbData1.ToString(), pbData2.ToString());

        aaeon12VData(testIntPtr, &amp;pbData1, &amp;pbData2); //Notice long delay, but doesn't change pbData1 or pbData2

        Console.WriteLine("After: {0} {1}", pbData1.ToString(), pbData2.ToString());
    }


    [DllImport("aonAPI.dll", EntryPoint = "?aaeonWdtGetDevID@@YAGPAX@Z", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
    public static extern ushort aaeonWdtGetDevID(IntPtr hInst);
    //C++ Code
    //DLLAPI WORD aaeonWdtGetDevID(HANDLE hInst);

    [DllImport("aonAPI.dll", EntryPoint = "?aaeon12VData@@YAJPAXPAE1@Z", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
    public static extern unsafe IntPtr aaeon12VData(IntPtr hInst, byte* pbData, byte* pbData2);
    // C++ code
    //DLLAPI HRESULT aaeon12VData(HANDLE hInst, BYTE* pbData, BYTE* pbData2);

    [DllImport("aonAPI.dll", EntryPoint = "?aaeonAPIOpen@@YAPAXK@Z", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
    public static extern IntPtr aaeonAPIOpen(uint reserved);
    // C++ code
    //DLLAPI HANDLE aaeonAPIOpen(DWORD reserved);   
</code></pre>

<p>And here is how the C++ program uses the API for the 12V:</p>

<pre><code>while(hInst == NULL)
{
    hInst = aaeonAPIOpen(0);
}

unsigned char temp;
unsigned char temp2;

if(aaeon12VData(hInst,&amp;temp,&amp;temp2) == S_OK)
{
    m_message.Format(_T("%d.%d"),temp2,temp);
}
</code></pre>

<p>Here is the dumpbin:</p>

<pre><code>      3    2 00001380 ?aaeon12VData@@YAJPAXPAE1@Z
      5    4 00001020 ?aaeonAPIOpen@@YAPAXK@Z
     10    9 00001040 ?aaeonWdtGetDevID@@YAGPAX@Z
</code></pre>
