Archive for the ‘Delphi.Net’ Category

Creating a VCL.Net Component in Rad Studio 2007

Monday, June 9th, 2008

Creating a new VCL.Net component for Rad Studio seems to be pretty straight forward. A lot like creating an old style VCL for Win32 component in fact. Just following the instructions in the CodeGear help file (ms-help://borland.bds5/devnet/creatingnewvclnetcomponent_xml.html) will get you where you want to go with 2 exceptions:


Changing Between Debug and Release Builds in Delphi.Net

Wednesday, June 4th, 2008

It took me a while to figure out how to do this, so before I forget here is how you do it:

  1. Open the Build Configuration Manager by selection Project | Configuration Manager.
  2. Highlight your project in the lowe list box.
  3. Select Debug or Release from the Configuration Name combobox.
  4. Click Apply.
  5. ClickClose.

Using Application Configuration Files with Delphi.Net

Wednesday, June 4th, 2008

When using Web References, Visual Studio automatically creates an application configuration file containing the URL(s) of the Web References.  These values can be adjusted using the Settings tab of the Project Properties dialog.  This seems to create a file named app.config causes the myproj.exe.config file to be created when the project is compiled.  All nice and simple.

Delphi.Net doesn’t seem to have this facility.  Adding an app.config created by Visual Studio to the Delphi.Net project will cause the myproj.exe.config to be created when the project is compiled, so that is fine.  But there doesn’t seem to be a visual designer for the configurable settings as their is in Visual Studio.

Using Web References in Delphi.Net

Wednesday, June 4th, 2008

While trying to port an existing C# application from Visual Studio to Delphi.Net I discovered two things:

  1. Delphi.Net requires the .Net SDK tool disco.exe, which Visual Studio does not.  For reasons that are unclear, disco.exe was not present on my development machine.  Even though Visual Studio and (presumably) the .Net SDK were both installed.  Re-installing the .Net SDK fixed the problem.
  2. When Delphi.Net creates the Web References it puts them in the same namespace as the project.  Visual Studio, on the other hand, puts each Web Reference into its own namespace.   For example, myproj.webref1, myproj.webref2, etc.  Probably 99%of the time this won’t be an issue but in my case two of the Web References defined the same class name.  This caused compile errors in Delphi.Net but not in Visual Studio.  Manually putting each Web Reference into its own namespace fixed the problem.

Adding Version Info to a .Net Executable

Friday, July 6th, 2007

I just spent a rather frustrating hour trying to figure out how to add version information to a .Net executable. These settings were not to be found in the Delphi Project | Options dialog as in previous versions of Delphi.


It turns out that you have to add an AssemblyInfo unit to the project. You then modify the source code of this unit to add things like your applications name and description and version. Seems like a bit of a step backward to me.