473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HELP:CoCreate fails in pinvoked DLL

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!!!!
Jul 21 '05 #1
6 1880
And this is on the CF or full framework?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Ron" <Ro*@nospam.com> wrote in message
news:D5*******************@nwrddc03.gnilink.net...
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!!!!

Jul 21 '05 #2
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!

And this is on the CF or full framework?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Ron" <Ro*@nospam.com> wrote in message
news:D5*******************@nwrddc03.gnilink.net...
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!!!!

Jul 21 '05 #3
Ron
anybody any ideas?

On 7-May-2004, "Ron" <Ro*@nospam.com> wrote:
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
"Ron" <Ro*@nospam.com> wrote in message
news:D5*******************@nwrddc03.gnilink.net...
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!!!!

Jul 21 '05 #4
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" <Ro*@nospam.com> wrote in message
news:jo*********************@nwrddc01.gnilink.net. ..
anybody any ideas?

On 7-May-2004, "Ron" <Ro*@nospam.com> wrote:
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
"Ron" <Ro*@nospam.com> wrote in message
news:D5*******************@nwrddc03.gnilink.net...
> 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!!!!

Jul 21 '05 #5
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!
On 11-May-2004, "Alex Feinman [MVP]" <pu*********@alexfeinman.com> wrote:

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" <Ro*@nospam.com> wrote in message
news:jo*********************@nwrddc01.gnilink.net. ..
anybody any ideas?

On 7-May-2004, "Ron" <Ro*@nospam.com> wrote:
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
> "Ron" <Ro*@nospam.com> wrote in message
> news:D5*******************@nwrddc03.gnilink.net...
> > 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!!!!

Jul 21 '05 #6
The only thing I can think of is clashing dll names...

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Ron" <Ro*@nospam.com> wrote in message
news:EH*********************@nwrddc01.gnilink.net. ..
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!
On 11-May-2004, "Alex Feinman [MVP]" <pu*********@alexfeinman.com> wrote:

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" <Ro*@nospam.com> wrote in message
news:jo*********************@nwrddc01.gnilink.net. ..
anybody any ideas?

On 7-May-2004, "Ron" <Ro*@nospam.com> wrote:

> 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
> > "Ron" <Ro*@nospam.com> wrote in message
> > news:D5*******************@nwrddc03.gnilink.net...
> > > 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!!!!

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sandie Towers | last post by:
We use a number of similar databases and frequently create a new database using a backup restore of another similar database. We try to keep changes between databases in _Additional tables - like...
0
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of...
9
by: Neurocon | last post by:
Hey everyone -- I've been having this problem for a couple weeks and was hoping maybe someone can help out a little bit. Synopsis: This SQL agent job contains code to perform a full...
28
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
3
by: Laxmikant Rashinkar | last post by:
Hi, I had a windows xp pro system with vs 2003 installation where the help was working fine. I than did a complete reinstall of win xp pro with sp2, followed by a reinstall of vs 2003. But...
1
by: Esteban Felipe | last post by:
Hi, thanks for reading. I hope to find some help here before I commit suicide because this is driving me crazy. Please excuse me if this looks like a long post, but I hope that a complete...
6
by: Ron | last post by:
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...
12
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug...
3
by: v.davis2 | last post by:
Hi all, I am attempting to use Access97 as the database to hold the results of a python script. I seem to be able to make simple SELECT clauses work (like SELECT * FROM TableName), but have not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.