Converts a numeric system error number (ie, from GetLastError()), into a string description.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Code:
' FormatMessage() API example by Lance C. Edmonds, April 2001 ' PB/CC code. Change PRINT to MSGBOX for PB/DLL (and delete WAITKEY$). #INCLUDE "win32api.inc" FUNCTION PBMAIN DIM ErrText AS ASCIIZ * 1024, Result&, ErNum& ErrNum& = %RPC_S_SERVER_UNAVAILABLE Result& = FormatMessage(%FORMAT_MESSAGE_FROM_SYSTEM, _ BYVAL 0, _ ErrNum&, _ MAKLNG(%LANG_NEUTRAL, %SUBLANG_DEFAULT), _ ErrText, _ SIZEOF(ErrText), _ BYVAL 0) REPLACE CHR$(13,10) WITH "" IN ErrText PRINT $DQ ErrText $DQ WAITKEY$ END FUNCTION
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Comment