Jump to content
Excelsior Forums


  • Content count

  • Joined

  • Last visited


Community Reputation

0 Neutral

About mlottman

  • Rank
  • Birthday 01/01/1
  1. Anyone have an example of how to use xFunction to obtain the String message of the last windows error code? I can obtain the error code fine, by using: xFunction f = new xFunction("kernel32","int GetLastError()"); return ((Integer) f.invoke()).intValue(); but when it comes to using FormatMessage to gets its string representation I run into trouble defining the buffer that the message is returned thru (lpBuffer). The function indicates that it wrote 24 characters to the buffer, but whenever I try to print the buffer, it is garbage characters. The Microsoft signature of the method is: DWORD FormatMessage( DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPTSTR lpBuffer, DWORD nSize, va_list* Arguments) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/formatmessage.asp Anyone have any examples of its proper use in xFunction? Thanks, Marc