.Net becomes more and more popular development platform. However the most advanced and powerfull development platform from Microsoft is Visual C++. VC++ applications are Win32 in heart, but could seamlessly interact with .Net framework. In fact, such applications host .Net framework an use the best from both worlds - Win32 and .Net.
Here is the list of some Win32 applications that host .Net runtime:
- Borland Delphi 8;
- Microsoft Visual Studio;
- C# and VB.Net compilers in .Net framework (csc.exe and vbc.exe), including .Net framework 2 beta;
- Microsoft SQL Server 2005 (Yukon) beta 2 - can host .Net framework to execute stored procedures written in .Net;
- Microsoft Internet information services (IIS) in part that host ASP.Net, including aspnet_isapi.dll;
- Microsoft Internet Explorer 6.0 in part that host .Net controls.
As you could see, even main tools for .Net development are written in managed code.
Delphi Win32 could do anything that could be done in Visual C++ except .Net-related features. Managed extensions for VCL are written to fill this gap as much as possible.
Managed extensions for VCL provide most complete way for .Net interop in Delphi and C++ Builder. In addition to all features provided by .Net interop, it could:
- Create .Net objects from assemblies not registered for COM, using assembly name or location, and loading .Net assemblies from streams;
- Create and use .Net objects that are not COM visible;
- Create .Net objects using parametrized constructors;
- Call properties/methods/fields of .Net object including static properties/methods/fields;
- Handle .Net exceptions and get all .Net exception properties including exception type name, StackTrace etc.;
- Get information about loaded instance of .Net framework such as memory usage and size of heap by generation;
- Load needed .Net runtime and even select which version of runtime to use on startup;
- Place .Net controls on VCL Win32 form;
- Use ADO.Net datasources as TDataSet descendants in Win32 applications. ADO.Net will be native and most supported API for SQL Server 2005 (Yukon);
- Host ASP.Net pages and services;
- Embed .Net assemblies into Win32 application as resources.
.Net object could be created using ClrCreateInstance function or ClrCreateInstanceFrom. Then, using generat wrappers from DotNet unit you could call object's properties and methods including static ones.
Ability to create application domains (AppDomain) turns application that uses Managed extensions for VCL into full-featured .Net host.
Beginning from version 1.20 it is possible to place .Net controls on Win32 VCL form. This application was created with Delphi Win32, property grid is the same that is used in Microsoft Visual Studio:
Known limitation is that .Net data binding is not supported.
Ability to use ADO.Net and ASP.Net from Win32 applications let your application use the best from .Net and Win32 worlds.
If you have any questions or comments, you are welcome in our forums.