H
Howard Kaikow
The FormatMessage API is specified as:
DWORD FormatMessage(
DWORD dwFlags,
LPCVOID lpSource,
DWORD dwMessageId,
DWORD dwLanguageId,
LPTSTR lpBuffer,
DWORD nSize,
va_list* Arguments)
I am trying to convert this to C#. So far I've got:
[System.Runtime.InteropServices.DllImport("kernel32",
EntryPoint="FormatMessage", ExactSpelling=false,
CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)]
private static extern uint FormatMessage (
uint dwFlags,
lpcvoid lpSource,
uint dwMessageId, uint dwLanguageId,
[MarshalAs(UnmanagedType.LPTStr)]string lpBuffer,
uint nSize,
va_list* Arguments);
Did I do LPTSTR correctly?
What do I need to do for LPCVOID and va_list*?
DWORD FormatMessage(
DWORD dwFlags,
LPCVOID lpSource,
DWORD dwMessageId,
DWORD dwLanguageId,
LPTSTR lpBuffer,
DWORD nSize,
va_list* Arguments)
I am trying to convert this to C#. So far I've got:
[System.Runtime.InteropServices.DllImport("kernel32",
EntryPoint="FormatMessage", ExactSpelling=false,
CharSet=System.Runtime.InteropServices.CharSet.Ansi, SetLastError=true)]
private static extern uint FormatMessage (
uint dwFlags,
lpcvoid lpSource,
uint dwMessageId, uint dwLanguageId,
[MarshalAs(UnmanagedType.LPTStr)]string lpBuffer,
uint nSize,
va_list* Arguments);
Did I do LPTSTR correctly?
What do I need to do for LPCVOID and va_list*?