HELP:CoCreate fails in pinvoked DLL

R

Ron

All,

I have a weird problem,

I have a Native DLL that CoCreates a COM object. If I call this DLL from a
native MFC app, everything goes just fine; If I call it from an managed
application with the exact same parameters, the CoCreate fails file
E_NOINTERFACE (x80004002).
I've played around with the different threading models (CoInitialize) but
that does not help..

Oh, I cannot consume the COM interface directly into the managed code, coz I
need the functionality currently in the managed DLL.

Please, can someone give me some hints?

Thanks!!!!
 
R

Ron

This would be the full framework. it works great on the CF.

I know I X-posted it into the compact framework NG, but I am hoping to get
some more replies doing so.

Thanks!
 
R

Ron

anybody any ideas?

This would be the full framework. it works great on the CF.

I know I X-posted it into the compact framework NG, but I am hoping to get
some more replies doing so.

Thanks!
 
A

Alex Feinman [MVP]

Is this your COM object or a system one? Are you exposing any managed
interfaces as COM ([ComVisible])?
 
R

Ron

Alex,

No, I am not calling the COM interface directly from Managed code. I use a
intermediate DLL to do the CoCreate for me.

The project I am working on is designed to be used on all available .NET
platforms (Full and Compact framework). Basically it contains a managed
Class that calls (via Pinvoke) into a (plain and simple) native support DLL.
One of the functions in this native DLL functions CoCreates an instance of a
COM object. This construction works great on everything but XP (Full
Framework). It keeps failing with 80004002 (E_NOINTERFACE).

To test the DLL, I created a native XP application that calls the function
in the DLL. This works just fine, but when it is called from a managed
application (pinvoke) it fails with E_ NOINTERFACE.

The reason I choose to go with a native (wrapper) DLL is that on the CF it
is not possible to consume COM interfaces via the typelib file.

Is it something stupid I did not think of? Or is it just not possible to
call a native DLL function that CoCreates a COM object from managed code in
the full framework?

Thanks!


Is this your COM object or a system one? Are you exposing any managed
interfaces as COM ([ComVisible])?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ron said:
anybody any ideas?
 
A

Alex Feinman [MVP]

The only thing I can think of is clashing dll names...

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ron said:
Alex,

No, I am not calling the COM interface directly from Managed code. I use a
intermediate DLL to do the CoCreate for me.

The project I am working on is designed to be used on all available .NET
platforms (Full and Compact framework). Basically it contains a managed
Class that calls (via Pinvoke) into a (plain and simple) native support DLL.
One of the functions in this native DLL functions CoCreates an instance of a
COM object. This construction works great on everything but XP (Full
Framework). It keeps failing with 80004002 (E_NOINTERFACE).

To test the DLL, I created a native XP application that calls the function
in the DLL. This works just fine, but when it is called from a managed
application (pinvoke) it fails with E_ NOINTERFACE.

The reason I choose to go with a native (wrapper) DLL is that on the CF it
is not possible to consume COM interfaces via the typelib file.

Is it something stupid I did not think of? Or is it just not possible to
call a native DLL function that CoCreates a COM object from managed code in
the full framework?

Thanks!


Is this your COM object or a system one? Are you exposing any managed
interfaces as COM ([ComVisible])?

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ron said:
anybody any ideas?


This would be the full framework. it works great on the CF.

I know I X-posted it into the compact framework NG, but I am hoping
to
get
some more replies doing so.

Thanks!


And this is on the CF or full framework?

--
Alex Feinman
---
Visit http://www.opennetcf.org
All,

I have a weird problem,

I have a Native DLL that CoCreates a COM object. If I call this
DLL
from
a
native MFC app, everything goes just fine; If I call it from an
managed
application with the exact same parameters, the CoCreate fails
file
E_NOINTERFACE (x80004002).
I've played around with the different threading models (CoInitialize)
but
that does not help..

Oh, I cannot consume the COM interface directly into the managed code,
coz
I
need the functionality currently in the managed DLL.

Please, can someone give me some hints?

Thanks!!!!
 

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