FIX: C1001: msc1.cpp, Line 581, Prototype Missing SemicolonID: Q97674
|
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'
These errors occur in any memory model and with any optimizations.fatal error C1001: internal compiler error
(compiler file 'msc1.cpp', line 581)
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 (;).
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.
The errors above occur because a semicolon is missing from the MakeInstanceActive() prototype. This error causes other errors later in the file.
/*
* 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 query words: 1.00 8.00
Keywords : kbCompiler
Version : 1.00
Platform : WINDOWS
Issue type :
Last Reviewed: August 8, 1999