Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limitation on number of COM servers?

Status
Not open for further replies.

DukeElliott

Programmer
Mar 12, 2002
2
US
I am having a problem on how many COM servers that can be loaded. I created 100 ATL inproc servers each with one ATL object (used the defaults on the Visual Studio 6.0 C++ wizards). I created an MFC exe dialog based project that creates the COM object in each ATL server. On the 60th CreateInstance call I get error code 0x80040154 (Class not registered). This is if each COM server is in debug build. (Note: Each object is released before creating the next one.) When I change the order of the objects that get created it still is always the 60th one that fails. The number of COM objects in a server does not appear to have any affect on the outcome. Also the size of the dll does not appear to affect the outcome (I added several dummy classes and a bunch of static string). I am running on NT4, Dual 667MHz, with 512M RAM (so resources should not be a factor).
If I create an instance of a COM objct that MS provides (i.e. COMCTL.Slider) first then start creating my objects I can then only create 53 objects.
If I build the COM servers in release build then I can create all 100.
Anyone else seen a similar problem?
 
I found the problem. Refer to MSDN PRB: A Process Can Map 64 (or Less) Statically-linked CRT DLLs (Q193462). There is a limit to the number of dlls that can statically link to the CRT in a process. NT4 has a limit of 64.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top