Groups | Blog | Home
all groups > dotnet interop > august 2006 >

dotnet interop : Calling managed code from unmanaged code not using COM?


Bjarnek
8/14/2006 3:55:33 AM
Hi

I have a program not written in .net (Clarion), and I want to call
functions written .net (C#) from this program.

I know that I can use COM technology to do that. But I want to know if
there is another way to do this with out using COM?

bjarne
TDC
8/14/2006 10:54:01 AM
I think you'd probably have to use C++ (managed + unmanaged) to pull
that off.

On a side note, I have a coworker that occasionally uses Clarion, and
he asked for help on linking Clarion to .NET, and the best I could come
up with was to create an ActiveX control (because he know how to link
in those) and then have the control invoke the .NET routines. Very
ugly, IMO.

Can you give me a rough sketch on how to create/invoke methods on
non-control based COM objects?

Tom

[quoted text, click to view]
Christian_Fröschlin
8/16/2006 12:00:00 AM
[quoted text, click to view]

If you pass delegates from C# via P/Invoke, you can later use
them as function pointers in native code. But you may not be
able to trigger that first call without resorting to COM or
AddThis Social Bookmark Button