Re: managed call from unmanaged class.... :-(

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: William DePalo [MVP VC++] (willd.no.spam_at_mvps.org)
Date: 02/13/05


Date: Sat, 12 Feb 2005 19:53:57 -0500


<subdene@hotmail.com> wrote in message
news:1108234027.167598.224910@f14g2000cwb.googlegroups.com...
> Thank you for your help. However, I need to get the unmanaged code to
> call a c++ .net managed function, ...

In the snippet I posted, the C++ module does just that.

It has a main() function which is unmanaged and a GoManaged() function which
is managed. That's one of the cool things about the C++ compiler in VS.Net.
As far as I know it is the only compiler that allows the developer to mix
managed and unmanaged functions in the same module. Those managed sections

> ... and not a c# one.

Well, there is no difference there. Managed C++ code such as my little
snippet can make use of assemblies in MC++ as well as C#.

Regards,
Will



Relevant Pages

  • Re: Code curosity - long, technical, and probably boring!
    ... > the second snippet, be aware that *ALMOST ALL OF WHAT YOU SEE* is there ... > of assembly language the compiler has produced from my source code (For ... > Elbonian, and somewhere, at the same time, an interpreter is listening ...
    (comp.sys.mac.system)
  • Re: Code curosity - long, technical, and probably boring!
    ... For what it's worth, this snippet, regardless of which form it's in, ... of assembly language the compiler has produced from my source code (For ... 00000044: 60000000 nop ...
    (comp.sys.mac.system)
  • Re: Buffer Overflow Errors
    ... Maybe if you have a compiler you ... >> Or perhaps using arrays in unmanaged code. ... >> Tony Morris ... the unsafe keyword does a lot more than that. ...
    (comp.lang.java.programmer)
  • Re: C# vs C++ regarding DirectX
    ... > if you want to build applications with .NET DirectX, ... one compiler could expose CLR features another language ... Managed C++ makes interop with unmanaged code a breeze. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: C# and my indispensable inline assembly code
    ... The unmanaged code would need to be compiled and linked and the ... managed code would need a ref to it. ... include the unmanaged dll into the exe like ilmerge does or something to do ... >> produced by the C# compiler is secure/verifiable code and this is ...
    (microsoft.public.dotnet.languages.csharp)