Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Need to call mixed-mode dll from native code.

Thread Tools

Need to call mixed-mode dll from native code.

Mike Kamzyuk
Posts: n/a
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

Reply With Quote
Victor Bazarov
Posts: n/a
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.*

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Second long argument to a JNI call on a Win32 DLL contains zero when it reaches the DLL pcarr01 Java 3 02-17-2005 09:30 AM
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM