Managed C++ & COM

  • Thread starter Thread starter Joe Kinsella
  • Start date Start date
J

Joe Kinsella

I wrote a managed C++ class that makes COM calls to INetConnectionManager to
enable/disable network connections. Unfortunately, the following call seems
to fail with a result of -2147417843 when calling this managed code from any
..Net application. The line that fails is:

HRESULT hres = CoCreateInstance(CLSID_ConnectionManager, 0, CLSCTX_ALL,
__uuidof(INetConnectionManager), (void**)&pMan);

However, if I take the same code and put it in a non-managed application, it
works fine.

Are there special considerations that need to be taken when calling COM code
from within managed code within a .Net application?

Joe
 
Not sure if this helps, but the error code maps to the following: "An
outgoing call cannot be made since the application is dispatching an
input-synchronous call."
 
Back
Top