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("ker nel32",
EntryPoint="For matMessage", ExactSpelling=f alse,
CharSet=System. Runtime.Interop Services.CharSe t.Ansi, SetLastError=tr ue)]
private static extern uint FormatMessage (
uint dwFlags,
lpcvoid lpSource,
uint dwMessageId, uint dwLanguageId,
[MarshalAs(Unman agedType.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("ker nel32",
EntryPoint="For matMessage", ExactSpelling=f alse,
CharSet=System. Runtime.Interop Services.CharSe t.Ansi, SetLastError=tr ue)]
private static extern uint FormatMessage (
uint dwFlags,
lpcvoid lpSource,
uint dwMessageId, uint dwLanguageId,
[MarshalAs(Unman agedType.LPTStr )]string lpBuffer,
uint nSize,
va_list* Arguments);
Did I do LPTSTR correctly?
What do I need to do for LPCVOID and va_list*?
Comment