Monday, September 6, 2010

Using NKDbgPrintfW in the Compact Framework


In case you wanted to use RETAILMSG or NKDbgPrintfW in your C# code and was struck dumb when you saw that no Dll was specified for the function on the MSDN page have no fear.
As you may have guessed, you need to use Coredll.dll for the declaration. I tried and confirmed it.

[DllImport("Coredll.dll")]
public static extern void NKDbgPrintfW(string str);

Format the string before sending it to the native function to avoid the multiple variable stuff...

No comments:

Post a Comment