473,322 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Data marshaling between unmanaged C++ & C#

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
Nov 13 '05 #1
4 11664
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/
Nov 13 '05 #2
Great thanks!!!
--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/

Nov 13 '05 #3
Another question:
How can I deal with C# types in unmanaged code?

"Thomas Scheidegger [MVP]" <sp************@swissonline.ch> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
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...roperatingwith
unmanagedcode.asp
Interop Marshaling
http://msdn.microsoft.com/library/en...eropmarshaling.
asp
Marshaling Data with Platform Invoke
http://msdn.microsoft.com/library/en...halingdatawith
platforminvoke.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/

Nov 13 '05 #4
> 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/
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JC | last post by:
How does garbage collection work in C# and VB.NET for data returned from COM object? For example, a COM object written in C++ returns a SAFEARRAY to C# or VB.NET, will this SAFEARRAY (mapped to...
0
by: Ash | last post by:
Hi, Has anyone ever tried using "COM marshaling" for cross- process communication? In particular, I am interested in cross-process marshaling between Managed Server and Unmanaged Client. ...
1
by: Nadav | last post by:
Hi I am about to write a performance crutial system, I am considering writing this system based on native COM or unmanaged C++ exposed as CLI, Now, I Wonder... does exposing a native code through...
2
by: Rookie | last post by:
Hi, I had a question on DllImport. On importing a function from a VC++ dll using DllImport (to a C# program), the function argument data types and the return types may be of a type that is not...
2
by: mirek | last post by:
Hi, I'm trying to import my old code to the .NET using managed wrappers. I've read "Managed Extensions for C++ Migration Guide" document and was trying to do what it stated in it. For example if...
3
by: bluewing | last post by:
Hi, everybody! I have to use Unmanaged Code DLL for my .Net Application. This Dll has a few functions that returns BYTE* value. but you know that C# does not have pointer type.... so, what data...
4
by: Bjarne Nielsen | last post by:
Hi all From a C# program, I need to call an unmanaged (C++) dll. The dll fills an array with variables and returns that to the C# program. When I have a fixed sized array, this works fine by...
3
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm trying to specify the requirement from unmanaged DLL component that will be used by a managed application written in C#. The unmanaged DLL is implementing some kind of algorithm for defect...
2
by: O.B. | last post by:
I have operation within a class that marshals the data into a byte array. Below are three different ways that work. Are there any downsides to using one over the the other? public virtual byte...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.