469,918 Members | 2,223 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,918 developers. It's quick & easy.

Need to call mixed-mode dll from native code.

Hello all. Basically, I need to call a mixed-mode dll's function
(which uses managed code) from a native or mixed-mode dll function
(which does not use managed code). I'm wondering if this could be
accomplished and how.
Here's the problem.

We have a third party app (TPA) capable of loading native and
mixed-mode dlls somehow (we don't know how). It loads our native dll
(OND) and allows us to use our code inside the app (that is, we could
call some of our functions).

Now, we have a mixed-mode dll (MMD) which we built for the purpose of
exposing OND's functionality to our .net apps.

We built some other app (SOA) on top of MMD as a dll (the gui in the
exe around it was easy). SOA is purely managed.

We then decided that it would be useful if TPA was using some of SOA's
functionality. Consequently, we decided to write another mixed-mode
dll (AMMD) which depends on SOA, and indirectly on MMD and OND.

Now, we got TPA to load AMMD no problem, however, AMMD is not capable
of calling either SOA's or MMD's functions. It does not have any
problem calling OND's functionality.

Here's the list of possible errors I encountered while trying all
combinations of solutions I could think of:

1: FileNotFoundException. SOA or one of its dependencies was not
found. When SOA is turned off, I get the same problem with MMD.
2: Unresolved token for various functions in MMD and SOA.
3: App hangs whenever any function from SOA or MMD is called.
4: Removing managed calls from MMD no longer produces those errors.

Ok...I've tried almost every possible combination of compiler switches,
ignoring libraries, importing libraries, using directives, etc. I
don't mind reading the MSDN articles for the fifth time, maybe I missed
one or two....

Does anyone know how to do this? Obviously, I'm using C++ here (except
the managed app which is in C#, but I could live without that).

Michael Kamzyuk

Jul 23 '05 #1
1 1993
Mike Kamzyuk wrote:
Hello all. Basically, I need to call a mixed-mode dll's function
(which uses managed code) [...]


Wrong newsgroup. Please find an appropriate one from the hierarchy
of Microsoft forums: microsoft.public.*

V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Perttu Pulkkinen | last post: by
reply views Thread by Swaroop Kumar | last post: by
2 posts views Thread by Paul A. Hoadley | last post: by
4 posts views Thread by natG | last post: by
13 posts views Thread by Kurda Yon | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.