Delphi 2007 Handbook








November 10, 2006

Tim Jarvis on Unmanaged Exports (and Mixed Mode , Again)

In his blog, Tim Jarvis shows how to call the cryptographic classes of the .NET library from a Delphi Win32 application.

In the recent discussions about mixed mode .NET compilers, I mentioned the fact that if you want to use specific features of .NET from within a Win32 Delphi application, you can take advantage of Delphi's unique support for unmanaged exports. These are Delphi .NET compiled libraries you can call from Win32 programs like regular DLLs. Today I noticed this very interesting post by Tim Jarvis, giving a wonderful example of the unmanaged exports technology.

While this certainly doesn't address all of the reasons for a mixed mode compiler, it is still a very relevant option. Also notice it is very simple to use. The big advantage is that by tying each source code file to a project requiring a different compiler, you can use the same notation for classes on both sides, something all the people complaining for my mixed mode posts failed to address. Now if Borland comes out with a way to let us specify a compiler for each unit, I'll agree that compiling into the same executable would be nice. But if I'm going to have to change the syntax of Delphi classes depending on the target platform, like in CLI/C++, I'll keep saying no thanks.





 

1 Comments

Tim Jarvis on Unmanaged Exports (and Mixed Mode , Again) 

"But if I'm going to have to change the syntax of 
Delphi classes depending on the target platform, 
like in CLI/C++, I'll keep saying no thanks"

If a compiler is "mixed mode" you have to mark it 
somehow. Anyway, it could be nice to be able to 
write:

Unit 1
-------
{$MANAGED ON}
...
TFoo = class  //<- Managed class
...

Unit 2
-------
{$MANAGED OFF}
...
TFoo = class  //<- Unmanaged class
...
TBar = managed class //<- managed in mixed mode

Comment by Kent Morwath on November 10, 16:51


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.