Our IIS-based web application is a mixture of C++ DLLs and ASP pages with
We have our own COM object (an LDAP wrapper) with both C++ and VB
interfaces. We are using this COM object "independently" in both
environments; in other words our C++ code creates it's own instance to
use, and our ASP pages use Server.CreateObject() to create an instance
for it's own use.
This works just fine, although it is a bit wasteful since the C++ code
and the ASP code would sometimes both independently "log in" to the
COM object using the same credentials.
However, we just realized that we can put a reference to the COM
object in the Session object and refer to the same instance in both
places using ISessionObject:putref_Value(). This is very cool, and
seems to work as expected. But I am a bit uneasy using this
shared-instance technique -- it doesn't feel as "safe" as our previous
Is this a safe way to use most COM objects?
Are there any potential deadlock/memory/runtime problems I need to be
aware of using this new shared-instance technique?
Finally, can somebody explain a little bit about how the same instance
of a COM object can be used simultaneously in 2 different runtime
Thanks in advance,