Managed C++ & COM

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
 
J

Joe Kinsella

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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top