Managed/Unmanaged code

  • Thread starter Thread starter AA2e72E
  • Start date Start date
A

AA2e72E

I am trying to understand this; I have a question.

I understand these statements are true:

1. Managed code is code that is executed by the CLR.
2. Managed code can access managed and unmanaged data.

How would I describe a C# Interrop DLL? As managed code? (It will be used by
an un-managed code (non .NET) client).
 
AA2e72E said:
I am trying to understand this; I have a question.

I understand these statements are true:

1. Managed code is code that is executed by the CLR.
2. Managed code can access managed and unmanaged data.

How would I describe a C# Interrop DLL? As managed code? (It will be used by
an un-managed code (non .NET) client).

How will the DLL be used by unmanaged code? I ask because there are
inherent problems in making DLL's that will be consumed by unmanaged
applications.

In any case, an assembly (dll or exe) that is built using a managed
compiler (C++.NET, VB.NET, C#) is a managed dll containing managed code.
 
I am trying to understand this; I have a question.

I understand these statements are true:

1. Managed code is code that is executed by the CLR.
2. Managed code can access managed and unmanaged data.

How would I describe a C# Interrop DLL? As managed code? (It will be used by
an un-managed code (non .NET) client).

It;s managed IF and ONLY IF you write it in a .NET language. It's un
managed otherwise (from .NET point of view at least)
You can call a managed code (.dll) from an unmanaged one (you simply
have to select "Registry for COM Interop" option)
You can call an unmanaged dll from .NET int his case it depends of the
unmanaged code how to do it, if it's a COM dll you can simply add a
reference to it (the IDE will take care of the rest) If it's a native
DLL you have to use P/invoke
 
Back
Top