views:

113

answers:

2

I'm making a project in C# and I want to use Unmanaged Exports and later to use it in Delphi. So can anyone explain me, how does Unmanaged Exports works, then how to use/import in Delphi. I'm using Visual Studio 2010 Express, on Windows 7 64 bit

+2  A: 

The best description I've heard for unmanaged exports is "reverse PInvoke". These are limited to scalar types, but let you consume managed assemblies from native code without the overhead of COM Interop.

I haven't tried it, but you can do this in C# with a little tweaking.

As an alternative, Delphi Prism supports this functionality out of the box.

Bruce McGee
I know that my code includes code examples, the thing is that I want to know after I build it in Visual Studio, what do I have to do next. How to import everything in delphi
Nikola Kocovski
Saying that "Delphi supports these out of the box" is a little confusing. *Prism* supports these out of the box, but Delphi and Delphi Prism are two separate things, and it doesn't look like the OP is actually doing the .NET end of the code in Prism.
Mason Wheeler
@Mason: You're right. I clarified the alternative suggestion to specify Delphi Prism.
Bruce McGee
@Nikola: On the native Delphi side, these are consumed just like any regular .dll.
Bruce McGee
+2  A: 

Brian Long wrote the classic article on Inverse P/Invoke to call managed C# code from Delphi Win32.

I'm not sure I'd use this kind of technology, but it is possible :-)

--jeroen

Jeroen Pluimers