How to call managed C++ dll methods from unmanaged MFC application?

Hi Experts!

I am planning to dedvelop a new component (dll) for my application using managed C++ code and call this component’s methods from my old MFC application. I found a lot of examples how to call unmanaged code from managed, by not opposite way. I am wondering if it is possible to and how it could be done.

Thank you for help,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In this 2 parts we covered calling DLL libraries from .NET code.
What about:
* Call COM servers
* Call managed components from unmanaged code.

> > (3) Are there any other (possibly Mono-specific) mechanisms to call from
> > unmanaged to managed code, assuming that both are running within a single
> > process?
> See the document mono/docs/embedding-api, it describes a mechanism to
> call methods in the CIL world from the C world

This is exactly what I was looking for, thank you. Is it possible to estimate
the overhead of mono_runtime_invoke() compared to a normal function call?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: GloomyFriar {http:#9635967}

Please leave any comments here within the next four days.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.