Is Marshalling only used only for Converting Structure to Byte and ViceVersa?
After going through Marshall
code snippet Got the Idea that marshalling is used to convert the Struct to Bytes and few other similar convesrions. But is this the only use of Marshall?
And while going through the MSDn sample I got the floowing line:
// Initialize unmanged memory to hold the struct.
IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(p));
And also from few other sites I got the follwing 开发者_如何学Clines like:
When you work with `unmanaged` code, you are `marshaling` data from your
`managed app-domain` to the `unmanaged` realm.
Now What is Manged
and UnManaged
domain or managed
and unmanaged
code. While writing my code How will I be able to distinguish what is Managed
and What is unmanaged
?
I just need to clear my fundamentals before going ahead, Any suggestion,doc or walkthrough as my sincere grattitude.
Thanks,
SubhenManaged code is code that runs using the CLR (Common Language Runtime)...
Unmanaged code is code NOT dependent on the CLR, during runtime, such as a C program.
There is a wikipedia article for most of the Computer Science topics out there... Google is a friend of any developer.
managed = .NET (CLR common language runtime)
unmanaged = native
Use 'mixed mode' assemblies, programmed in C++/CLR, to bridge the two realms together.
精彩评论