FIX: C1001: msc1.cpp, Line 581, Prototype Missing Semicolon

Last reviewed: September 16, 1997
Article ID: Q97674
1.00 WINDOWS kbtool kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE), included with:

        - Microsoft Visual C++ for Windows, version 1.0
    

SYMPTOMS

An attempt to compile the source code below fails and the C/C++ compiler generates following messages:

   error C2085: 'hInst' : not in formal parameter list

   error C2061: syntax error : identifier 'HWAVEIN'

   fatal error C1001: internal compiler error
     (compiler file 'msc1.cpp', line 581)

These errors occur in any memory model and with any optimizations.

RESOLUTION

To eliminate the C1001 internal compiler error, first correct the other errors in the code. To do so, terminate the MakeInstanceActive() function prototype with a semicolon (;).

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. This problem was corrected in C/C++ compiler version 8.0c, included with Visual C++ for Windows, version 1.5.

MORE INFORMATION

The errors above occur because a semicolon is missing from the MakeInstanceActive() prototype. This error causes other errors later in the file.

Sample Code

/*
 * Compile options needed: none
 */

#include <windows.h>

BOOL InitApplication(HANDLE); BOOL InitInstance(HANDLE, int); HWND MakeInstanceActive(char *WindowName) // Semi-colon missing here

HANDLE hInst; HWAVEIN ghWaveIn = NULL;

WORD    gwWantToClose = FALSE;

int PASCAL WinMain(HANDLE hInstance,
                   HANDLE hPrevInstance,
                   LPSTR  lpCmdLine,
                   int    nCmdShow)
{
   MSG msg;

   if (hPrevInstance)
      {
      MakeInstanceActive("TestClass");
      return FALSE;
      }

   if (!hPrevInstance & !InitApplication(hInstance))
      return (FALSE);

   if (!InitInstance(hInstance, nCmdShow))
      return (FALSE);

   while (GetMessage(&msg, NULL, NULL, NULL))
      {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
      }

   return (msg.wParam);
}


Additional reference words: 1.00 8.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubcategory: CLIss
Keywords : CLIss kbbuglist kbfixlist kbtool
Version : 1.00
Platform : WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.