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).
Re: Need to call mixed-mode dll from native code.
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.*
|All times are GMT. The time now is 05:31 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.