How to increase PythonWin v2.0: COM browser limits?
anthony_gray at yahoo.com
anthony_gray at yahoo.com
Wed Sep 19 15:10:36 EDT 2001
Dear Python guys:
I found your post during a heavy component categories debugging
session on my machine, where the COMCAT.DLL component categories
manager's category enumerator (ICatInformation:EnumCategories) was
dying with "E_OUTOFMEMORY" errors -2147024882 (8007000E).
After corresponing with M$, I figured this out on my own. It turns
out that some bad control was registering and creating malformed
CATID's that kill the enumerator. Go have a look in regedit and
search through HKEY_CLASSES_ROOT\Component Categories and see if you
have any malformed CATID's. I had two with a missing closing brace,
{7DD95801-9882-11CF-9FA9-00AA006C42C4 "Controls that are safely
scriptable"
{7DD95802-9882-11CF-9FA9-00AA006C42C4 "Controls safely initializable
from persistent data"
which are botched versions of very common categories. I deleted them
and everything started to work properly. You can safely kill them
provided that the correct versions are there. I searched the
registry to try to find the control whose installation had put these
bad keys in but was unsuccessful. Could be MS, could be somebody
else's control.
If you find that this was the problem, you could have your app
double-check for and delete these keys on startup programmatically.
Best of luck,
Tony Gray
--- In python-list at y..., Ben Hutchings <ben.hutchings at r...> wrote:
> No, not that either. 'Out of memory' error messages are very often
> the result of a programmer incorrectly assuming that some operation
> can only fail due to lack of memory.
>
> In fact, by adding a print statement to the loop that's iterating
over
> the categories to add them to the tree, I discovered that it yields
> more or less the same results as OLEView (a similar program
available
> from Microsoft). The exception is only raised after these results
> have been returned.
>
> The wrapper for COM enumerators, in true Pythonic style, does not
> check the size of the collection in advance, but attempts to read
> items until this yields an error. I think that the category
> enumerator implementation is reporting the no-more-items error in
the
> wrong way (returning E_OUTOFMEMORY rather than S_FALSE), so the
> wrapper does not translate it into an IndexError exception which
> would cause the loop to terminate successfully. OLEView probably
> just doesn't check for the error but displays what it already got.
>
More information about the Python-list
mailing list