Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This might be what you're looking for (I've answered similiar question here before: <a href="https://stackoverflow.com/questions/18126017/how-to-use-c-projects-for-windows-phone-c/18128735#18128735">how to : use c++ projects for windows phone (C#)</a>)</p> <p>a) Load symbols directly from C library, for example:</p> <pre><code>using System; using System.Runtime.InteropServices; static class win32 { [DllImport("kernel32.dll")] public static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll")] public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); [DllImport("kernel32.dll")] public static extern bool FreeLibrary(IntPtr hModule); } </code></pre> <p>(this is taken from: <a href="http://www.andyrushton.co.uk/csharp-dynamic-loading-of-a-c-dll-at-run-time/" rel="nofollow noreferrer">http://www.andyrushton.co.uk/csharp-dynamic-loading-of-a-c-dll-at-run-time/</a> after brief googling)</p> <p>You need to export the C++ interface methods as "C" for that, e.g.:</p> <pre><code>extern "C" __declspec( dllexport ) int MyFunc(long parm1); </code></pre> <p>(from MSDN: <a href="http://msdn.microsoft.com/en-us/library/wf2w9f6x.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/wf2w9f6x.aspx</a>)</p> <p>b) Use a wrapper in C++/CLI to connect unmanaged C++ to managed C#:</p> <p>here's a good example: <a href="http://www.codeproject.com/Articles/19354/Quick-C-CLI-Learn-C-CLI-in-less-than-10-minutes" rel="nofollow noreferrer">http://www.codeproject.com/Articles/19354/Quick-C-CLI-Learn-C-CLI-in-less-than-10-minutes</a></p> <p>Do note that the syntax is somewhat weird at first look, and not eveything can be used. However, what you gain is ability to use the C++ classes - something that exporting "C" prohibits you from doing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload