--- mstools/samples/console/alocfree.c 2018/08/09 18:21:20 1.1.1.2 +++ mstools/samples/console/alocfree.c 2018/08/09 18:23:16 1.1.1.3 @@ -1,10 +1,18 @@ + +/******************************************************************************\ +* This is a part of the Microsoft Source Code Samples. +* Copyright (C) 1993 Microsoft Corporation. +* All rights reserved. +* This source code is only intended as a supplement to +* Microsoft Development Tools and/or WinHelp documentation. +* See these sources for detailed information regarding the +* Microsoft samples programs. +\******************************************************************************/ + #include #include #include "console.h" -/* Microsoft Developer Support - Copyright (c) 1992 Microsoft Corporation */ - /********************************************************************* * FUNCTION: demoAllocFree(HANDLE hConOld, HANDLE *hConOut) * * * @@ -25,12 +33,10 @@ void demoAllocFree(HANDLE hConOld, HANDL "with AllocConsole. Hit return to continue..."); myGetchar(); bSuccess = FreeConsole(); - if (!bSuccess) - Beep(600, 500); /* can't output an error message now! */ + PERR(bSuccess, "FreeConsole"); Sleep(3000); bSuccess = AllocConsole(); - if (!bSuccess) - Beep(600, 500); + PERR(bSuccess, "AllocConsole"); *hConOut = GetStdHandle(STD_OUTPUT_HANDLE); /* set our console text attribute */ bSuccess = SetConsoleTextAttribute(*hConOut, FOREGROUND_CYAN);