FIX: _setmaxstdio Causes Access ViolationLast reviewed: September 19, 1997Article ID: Q145996 |
4.00
WINDOWS NT
kbusage kbbuglist kbfixlist
The information in this article applies to:
SYMPTOMSThe CRT function _setmaxstdio does not work properly. The function sets the maximum number of files an application can open with the stream I/O functions, like fopen. It is documented in the README book in the online documentation, and in the Vcread.wri file. Using _setmaxstdio results in the following error when you exit the program or call the fopen function:
Unhandled exception in <Project>.exe: 0xC0000005: Access Violation RESOLUTIONDo not use the _setmaxstdio function. Here are two workarounds:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1.
MORE INFORMATION
Sample Code to Reproduce Problem
/* Compile options needed: none */ #include <stdio.h> void main(){ _setmaxstdio(511); FILE *text = fopen("textfile.txt","w"); fclose(text);}
|
Additional reference words: 4.00 4.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |