Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FormatMessage and GetLastError Win32 API functions

Status
Not open for further replies.

CFB

Programmer
Jan 11, 2001
74
US
Has anyone used or have a an example of the GetLastError function passing the error code to the FormatMessage function and producing an error message? The GetLastError function is very straight forward, but I'm having a hard time working with the FormatMessage function due to the way you must identify a buffer to store the error message in and then point to that buffer. Any help would be appreciated. Thanks.
 
HOWTO: Use the Win32 API FormatMessage Function with Visual FoxPro

You identify a buffer to store the error message in by allocating memory in a variable:
lcMyBuffer=SPACE(100)

You point to that buffer by passing the variable by reference:
MyFunction(@lcMyBuffer) Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top