Microsoft KB Archive/97674

{|
 * width="100%"|

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

 * }

Q97674

-

The information in this article applies to:


 * The Microsoft C/C++ Compiler (CL.EXE),
 * Microsoft Visual C++, 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 */


 * 1) include 

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(&quot;TestClass&quot;); 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 query words: 1.00 8.00

Keywords : kb16bitonly kbCompiler

Issue type :

Technology :