how to load c# dll into vc++

  • Thread starter Thread starter Kanaiya
  • Start date Start date
K

Kanaiya

hello
i get some answers from previous messages but i am not able to get
proper idea in vc++ case. can u explain me proper. bye.
 
Hi,

I would like to join question Kanaiya has asked. How can I call from
unmanaged (classic,mfc,etc.) a c# dll funcitons? Should I do COM/DCOM/.NET
dll? Easiest way? Is it possible at all?

Thanks,
Anton
 
hello
i get some answers from previous messages but i am not able to get
proper idea in vc++ case. can u explain me proper. bye.

From Managed C++ you would just import your C# .dll like you do with the
<mscorlib.dll>. If you want to access the C# .dll's functionality from
non-managed code then you would need to expose the C# .dll to COM
through interop and access it in C++ like you would any other COM
object.

Tim
 
Anton ml. Vahèiè said:
How can I call from
unmanaged (classic,mfc,etc.) a c# dll funcitons?

This is a C++ newsgroup so ...

I recommend this book for anyone trying to build an application using (some
dialect of) C++ in which native and managed code bases need to be able to
interoperate:

http://www.apress.com/book/bookDisplay.html?bID=61

Of all the the MS .Net languages, managed C++ is the only one which allows
you to mix mananged and unmanaged code in the same module. Now, since
Managed C++ is a .Net language, and since all .Net languages share the same
object model, you can write a managed C++ wrapper for your C# code. And
since unmanaged C++ code can call managed C++ code you can have a unmanaged
(possibly MFC) wrapper, too
Should I do COM/DCOM/.NET
dll? Easiest way? Is it possible at all?

Certainly possible. The way I described is useful in some situations. For
others it is more natural to view the C# class as a COM object and use
strictly COM techniques to make the call. Only you can know which method you
"should" use. After reading the book or other samples you will be able to
make an informed decision as to what fits your particular situation.

Regards,
Will
 
Back
Top