-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This problem is covered specifically in the nsCOMPtr user's guide.
See
<http://www.mozilla.org/projects/xpcom/nsCOMPtr.html
#NSCAP_FEATURE_DEBUG_PTR_TYPES>
Essentially, the entire app must be compiled with the same setting of
the build flag |NSCAP_FEATURE_DEBUG_PTR_TYPES|. By _default_ this is
controlled by the debug flags. So, unless you take specific action,
the bad behavior you have experienced is the typical result of mixing
debug and non-debug pieces together in your build. In particular, a
debug build of the XPCOM library mixed with non-debug builds of any
other components will cause link problems. You can have a
link-compatible debug build of XPCOM by defining
|NSCAP_DISABLE_DEBUG_PTR_TYPES|.
There have been bug reports against this in the past, and there are
lengthy explanations in some of them. I would cite one but bugzilla
is currently backing up so I'll have to search later.
Yes, the thing you are doing now is a hack. You've made a function
with the right name available, but it's unrelated to the actual
inheritance of |nsCOMPtr| in the place where you are wanting it. As
it turns out ... everything is the right shape, and your app works,
but that's really just a coincidence ;-) The real answer is to fix
your flags so |NSCAP_FEATURE_DEBUG_PTR_TYPES| is consistent.
Hope this helps,
______________________________________________________________________
Scott Collins <http://ScottCollins.net/>
-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.2
Comment: get my key at <http://ScottCollins.net/#key>
iQA/AwUBOpOb2vGmojMuVn+fEQJDEQCgg1BuUtBROOSD3yF0tQLYTo6VDKYAoLz5
GftjenY22qehkx1pFbQVp9OQ
=NkeP
-----END PGP SIGNATURE-----