PRB: Potential Limit of 64 Different .OCX Files per ProcessLast reviewed: August 7, 1997Article ID: Q133324 |
The information in this article applies to:
SYMPTOMSAttempting to create or insert an OLE control may cause the following assertion message to be generated:
Assertion Failed: <application>: File ctlmodul.cpp, Line 192 CAUSEThe assertion is the function _AfxGetCtlModuleStatics and is the following:
ASSERT(_afxCtlTlsIndex != NULL_TLS);The assertion fails because the process creating the OLE control has used up all of its available thread-local storage (TLS) slots.
RESOLUTIONTo avoid the problem, do one of the following:
STATUSThis behavior is by design.
MORE INFORMATIONThe 32-bit MFC implementation of OLE controls uses TLS to store control module state information. One TLS slot is allocated every time a process attaches to a new OLE control (.OCX) file. One process may allocate up to TLS_MINIMUM_AVAILABLE TLS slots. TLS_MINIMUM_AVAILABLE is guaranteed to be at least 64 slots on all systems. NOTE: TLS_MINIMUM_AVAILABLE is a Win32 limitation rather than an MFC limitation. This problem will occur when a process tries to access more than TLS_MINIMUM_AVAILABLE TLS slots, whether they are used for control module state information or for some other purpose. TLS_MINIMUM_AVAILABLE is the maximum number of different .OCX files (packages that contain OLE controls) that may be loaded before the assertion occurs. Depending on how your container uses thread local storage, you may encounter the assertion after loading a fewer number of .OCX files. NOTE: This does not restrict the number of OLE Controls that can be placed in a container simultaneously. As long as your process uses no more than TLS_MINIMUM_AVAILABLE TLS slots, the number of controls that can be created is constrained only by available memory. TLS allocation and usage was changed with MFC version 4.0 and the limit on the number of simultaneous OLE controls has effectively been removed.
REFERENCESChapter 8, Thread-Local Storage, in the book Advanced Windows NT, The Developer's Guide to the Win32 Application Programming Interface by Jeffrey Richter.
|
Additional query words: 2.0 2.00 2.1 2.10 2.2 2.20
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |