delphi

Exception handling in Delphi

Is there a good way to find out which exceptions a procedure/function can raise in Delphi (including it's called procedures/functions)? In Java you always have to declare which exceptions that can be thrown, but this is not the case in Delphi, which could lead to unhandled exceptions. Are there any code analysis tools that detects un...

Is there an 'Unformat' method in delphi

Has anyone written an 'Unformat' routine for Delphi? What I'm imagining is the opposite of Format and looks something like this Unformat('a number %n and another %n',[float1, float2]); So you could unpack a string into a series of variables using format strings. I've looked at the 'Format' routine in SysUtils, but I've never used ...

Qt or Delphi... If you were to choose one over the other?

If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a bit more time working with Builder C++. Please take out the cross platform ability of Qt in yo...

Which logging library is better?

I was wondering; which logging libraries for Delphi do you prefer? CodeSite SmartInspect Log4Delphi TraceFormat Please try to add a reasoning why you prefer one over the other if you've used more than one. I'll add suggestions to this question to keep things readable. ...

Delphi Component Serialization

Has anyone run into issues serializing components into a file and reading them back, specifically in the area where the component vendor upgrades the VCL components. For example a file serialized with DelphiX and then years later read back with delphiY. Do the serialization formats change and if so what can be done to prevent errors re...

Using DLR from Unmanaged Code

Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi? For example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to replace VBSCRIPT. However, we would need to provide Ruby/Python...

Using 7-Zip from Delphi?

I would like to use the 7-Zip DLLs from Delphi but have not been able to find decent documentation or examples. Does anyone know how to use the 7-Zip DLLs from Delphi? ...

Delphi Out of resources

Every project I compile with Delphi 7, in which I do not compile with run-time packages, gives a linker error: "Too many resources". Even a blank application gives this error. In other words: Delphi died on me. ...

In Delphi, How do I get an enumerator from LocalPolicy.CurrentProfile.GloballyOpenPorts in the Firewall API

I am writing some code to see if there is a hole in the firewall exception list for WinXP and Vista for a specific port used by our client software. I can see that I can use the NetFwMgr.LocalPolicy.CurrentProfile.GloballyOpenPorts to get a list of the current Open port exceptions but can not figure out how to get that enumerated list ...

How to fix a corrupt Delphi 2009 Install

I installed both the Delphi 2009 trial and actual release via the web installer when I received them and experienced the same errors when installing both. Both times it appears that the core web installer failed when it went to spawn the additional install packages for boost, documentation and dbtools. (It brought up a findfile dialog ...

In Delphi, is TDataSet thread safe?

I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this before. I've seen...

What do I need to start using Embedded Firebird with Delphi?

I wan a good lightweight FOSS embedded database to use with Delphi. I've used DBISAM by Elevate Software for years and I just love it, but I like to share the source on some of my utilities, and it is closed source commercial. Someone suggested Embedded Firebird as a FOSS alternative. Where do I get components to use it with Delp...

Transmitfile, download with weird behaviour

I am using httpresponse.Transmitfile to download files. If I, in the file download dialog, choose to save in a different folder than the suggested one, the download rate drops down to 10 - 20 kb. If I cancel, or always choose to download in the same folder, then transfer rate are 200 kb and more. Here are my code : procedure TDefault.L...

Opening two HTMLHelp files simultaneously in Delphi causes both help windows to hang.

In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form also has a TForm.Help...

Prevent implicit import of units in Delphi packages

Is there a way to prevent packages in Delphi to implicitly import units that are not listed in the "Contains" list? I'm looking for a compiler directive that makes the build to fail if it tries to do an implicit import. Problems occur when you install a package into the IDE that implicitly imports unit A and then you try to install anot...

Setting Remote Launch in DCOM

I can use DCOMCNFG to disable remote launch on my DCOM application, but I would like to do this programatically. I looked at CoInitializeSecurity, but that does not seem to do it. Anyone done this? I am using Delphi BTW. ...

Do Delphi class vars have global or thread local storage?

My guess is that class variables ("class var") are truly global in storage (that is, one instance for the entire application). But I am wondering whether this is the case, or whether they are thread in storage (eg similar to a "threadvar") - once instance per thread. Anyone know? Edit: changed "scope" to "storage" as this is in fact t...

What impact (if any) does Delphi 2009's switch to Unicode(/UTF16) have on executable size and memory footprint?

Here's one from the "No question's too dumb" department: Well, as the subject says: Is there an impact? If so, how much? Will all the string literals I have in my code and in my DFM resources now take up twice as much space inside the compiled binaries? What about runtime memory usage of compiled applications? Will all the string variab...

What's the Best Logging Package for Delphi?

Choosing the "best" logging package for Delphi will naturally be rather subjective, but it would be good to know what the main options are, and the popular opinion on them. I'm basically looking for a robust logging package that will: Log to a file that I specify. Record a stack trace if I pass it an Exception. Ideally be popular, and...

In Delphi, how can you have currency data types shown in different currencies in different forms?

I need to write a Delphi application that pulls entries up from various tables in a database, and different entries will be in different currencies. Thus, I need to show a different number of decimal places and a different currency character for every Currency data type ($, Pounds, Euros, etc) depending on the currency of the item I've ...