Data marshaling between unmanaged C++ & C#

  • Thread starter Thread starter Vadym Stetsyak
  • Start date Start date
V

Vadym Stetsyak

Hi there!!!

I'm looking for any resources on the subject.
Any help will be appreciated!

--
Vadym Stetsyak
ICQ 161730125

He, who commands the past - commands the future
He, who commands the present - commands the past
 
How can I deal with C# types in unmanaged code?

This is only possible with COM-Interop.
Thus you have to design your C# class to be COM compliant,
then register it as a COM component with the REGASM tool:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp

Sure, the unmanaged/C++ side has to use the COM API / interfaces
(like CoCreateInstance) to access this COM component.


Note, there is 'Managed C++' where you can mix
managed and unmanaged C++ code:
http://msdn.microsoft.com/library/en-us/vcedit/html/vcorivisualcmainnode.asp

http://msdn.microsoft.com/library/en-us/vcmex/html/vcconMCOverview.asp

Thus you could use 'Managed C++' as a bridge between
unmanaged C++ code and C#.
 
Back
Top