Wrapped C++ versus Delegate

  • Thread starter Thread starter Saya
  • Start date Start date
S

Saya

Hi,

A question: is wrapping a C++ class with a Managed_C++ shell the same as
using a Delegate ?
Thank you.
 
Saya,

The question that you present doesn't make much sense, as a delegate and
a managed wrapper are two separate things.

Wrapping a C++ class using Managed C++ is a way to expose native C++
class code to managed code.

Delegates are type-safe function references. The two are very different
things.

The only way that they are similar is that they can expose
managed/unmanaged code to the opposite of what they are. In other words,
the Managed C++ wrapper exposes unmanaged code to the native world, and the
delegate can be passed through the P/Invoke layer (as a function pointer) to
expose managed code to the unmanaged world.

Hope this helps.
 
Back
Top