Displaying Errors to the User

Whenever a network DDE function returns an error value, you can retrieve an error message suitable for displaying to a user by using the NDdeGetErrorString function.

DisplayNDdeErrorString( UINT uCode, LPTSTR lpszTitle )
{
   char buf[256];

   NDdeGetErrorString( 
      uCode,
      buf,
      sizeof(buf)
     );
   MessageBox( NULL, buf, lpszTitle, MB_ICONEXCLAMATION | MB_OK );
}