Connecting Tech Pros Worldwide Forums | Help | Site Map

Data marshaling between unmanaged C++ & C#

Vadym Stetsyak
Guest
 
Posts: n/a
#1: Nov 13 '05
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



Thomas Scheidegger [MVP]
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Data marshaling between unmanaged C++ & C#


Check MSDN
Introduction articles:
http://msdn.microsoft.com/library/en...rp07152002.asp

http://msdn.microsoft.com/library/en...rp09192002.asp

Documentation
http://msdn.microsoft.com/library/en...anagedcode.asp

Interop Marshaling
http://msdn.microsoft.com/library/en...marshaling.asp

Marshaling Data with Platform Invoke
http://msdn.microsoft.com/library/en...forminvoke.asp


and visit this great site:
http://www.dotnetinterop.com/


and read this book (COM Interop)
http://www.amazon.com/exec/obidos/ASIN/067232170X/


For more, use newsgroup:
microsoft.public.dotnet.framework.interop




--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/


Vadym Stetsyak
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Data marshaling between unmanaged C++ & C#


Great thanks!!!
[color=blue]
> --
> Thomas Scheidegger - MVP .NET - 'NETMaster'
> http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/
>
>[/color]


Vadym Stetsyak
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Data marshaling between unmanaged C++ & C#


Another question:
How can I deal with C# types in unmanaged code?

"Thomas Scheidegger [MVP]" <spam.netmaster@swissonline.ch> wrote in message
news:e9ZgsMHSDHA.2892@TK2MSFTNGP10.phx.gbl...[color=blue]
> Check MSDN
> Introduction articles:
>[/color]
http://msdn.microsoft.com/library/en...rp07152002.asp[color=blue]
>
>[/color]
http://msdn.microsoft.com/library/en...rp09192002.asp[color=blue]
>
> Documentation
>[/color]
http://msdn.microsoft.com/library/en...roperatingwith
unmanagedcode.asp[color=blue]
>
> Interop Marshaling
>[/color]
http://msdn.microsoft.com/library/en...eropmarshaling.
asp[color=blue]
>
> Marshaling Data with Platform Invoke
>[/color]
http://msdn.microsoft.com/library/en...halingdatawith
platforminvoke.asp[color=blue]
>
>
> and visit this great site:
> http://www.dotnetinterop.com/
>
>
> and read this book (COM Interop)
> http://www.amazon.com/exec/obidos/ASIN/067232170X/
>
>
> For more, use newsgroup:
> microsoft.public.dotnet.framework.interop
>
>
>
>
> --
> Thomas Scheidegger - MVP .NET - 'NETMaster'
> http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/
>
>[/color]


Thomas Scheidegger [MVP]
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Data marshaling between unmanaged C++ & C#


> 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...nentstocom.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...lcmainnode.asp

http://msdn.microsoft.com/library/en...MCOverview.asp

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




--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/


Closed Thread