Back to the WFC main page

Convert_NERR_Code_to_String

$Revision: 16 $

Description

This function converts NERR_* error codes to a human readable string. I had to write this because calling FormatMessage() with the FORMAT_MESSAGE_FROM_SYSTEM doesn't work. If the error code sent to this function is not a network error, it will still try to convert it to something a human would understand.

Example

#include <wfc.h>
#pragma hdrstop

int _tmain( int number_of_command_line_arguments, LPCTSTR command_line_arguments[] )
{
   WFCTRACEINIT( TEXT( "_tmain()" ) );

   BYTE buffer[ 4096 ];

   DWORD return_code = 0;

   return_code = NetWkstaGetInfo( NULL, 302, buffer );

   if ( return_code != NERR_Success )
   {
      CString error_message;

      Convert_NERR_Code_to_String( return_code, error_message );

      _tprintf( TEXT( "Network error, %s\n" ), (LPCTSTR) error_message );
   }
}

Copyright, 2000, Samuel R. Blackburn
$Workfile: lmerr.cpp $
$Modtime: 1/17/00 9:26a $