Posts

Showing posts from April, 2019

TTaskDialog - A custom dialog in Delphi

Image
TTaskDialog   is a non-visual component, which shows full-featured dialog at run-time which introduced in Delphi 2009. A task dialog is somewhat like the standard message dialog in the VCL but we can also add extra buttons, check-boxes, radio buttons besides the usual default sets of buttons like OK, Cancel, Yes, No. We can set caption, title and text for dialog also. This component is available on Dialog tab in Component Palette. Dialog is shown with calling  Execute function and if it gets True then property ModalResult has ID of pressed button. Execute returns True if the dialog was opened successfully. TTaskDialog provides important properties like Caption, Title, Text to show dialog captions and messages in a dialog. Other properties are like property Buttons to add extra buttons,  MainIcon  to set values for standard icons: none, warning, error, information, shield and property RadioButton has the radio-button object, which was cl...

F1026 File not found: ‘Designintf.dcu’ Delphi error

Image
When I was porting some components from old Delphi 7 version to new Delphi XE5  version, I was getting “F1026 File not found: ‘ Designintf.dcu ’” error frequently. And I always seem to forget the solution for the error messages about Designintf. So for my memory and for your help, here I will explain how to solve this issue. DesignIntf Defines the interfaces and classes used by the property editors in the IDE. DesignIntf used to be a supplied as a .DCU file and was in the VCL package in old Delphi versions. Since it was a .DCU file, you could use it in both run-time and design-time packages. Now in newer Delphi versions it is replaced with following units. • DesignIntf, • DesignEditors, • DesignConst • DesignMenus • DesignWindows Solution These above units are supplied in the DesignIde package. So to solve this issue we just need to add DesignIde.dcp to required package list.  Since the DesignIde package is design-time only, you can use these units only ...

DsgnIntf.dcu not found Delphi error

I was transferring my Code from Delphi 5 to Delphi XE5 while running I got error DsgnIntf.dcu not found. And I found that DsgnIntf.dcu was a part of ToolsAPI that introduced in Delphi 5. Now in newer versions of Delphi this file has been replaced by DesignIntf.pas . The property editors units and other design-time files were also moved into DesignEditors, DesignMenus, DesignWindows . So the solution is to replace all references of DsgnIntf to DesignIntf in a unit. But, when we have a single package for component development then we must separate run-time code and design-time code into separate packages. Create a run-time only package that contains just your component code. Create a design-time only package that specifies your run-time only package and the IDE's DesignIDE package in its requires list, and contains just your property editor and registration code. Then you can install the design-time only package into the IDE, and refer to the run-time only package in you...

F2051: Unit %s was compiled with a different version of '%s'. Delphi error

Image
This is a Delphi error occurs when interface part of a unit has been changed and the compiler cannot compile another unit which relies on above unit because the source is not available or not valid. Some errors we got. F2051 Unit System.SysUtils was compiled with a different version of "".GetMappedFileName F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove F2051 Unit webMail was compiled with a different version of ucCodeSiteInterface F2051   Unit ExtActns was compiled with a different version of UrlMin.IbindStatusCallBack F2051   Unit cxClasses was compiled with a different version of Forms.TCustomForm.SetWindowState F2051   Unit Data.DBXCommon was compiled with a different version of System.JSON.TJSONObject For example When we have a situation like below where Unit A uses both unit B and unit C and Unit B uses C.  Unit B and C are compiled and for some reason the source of unit ...

E2250 There is no overloaded version of '%s' that can be called with these arguments Delphi error

While migrating our legacy project from Delphi 7 to Delphi XE5, we encountered " E2250 There is no overloaded version of '%s' that can be called with these arguments " error many times. The codes were written in Delphi 7 which were working fine but raised the error when compiled in Delphi XE5 or later. We faced the error on statements where we have called functions like  Pos , StrPas , StrCopy , Offset , StrToInt64 etc. So here for help to others, I will explain why we get this error and how to solve it. Some errors we faced frequently. E2250 There is no overloaded version of 'Offset' that can be called with these arguments E2250 There is no overloaded version of 'StrCopy' that can be called with these arguments E2250 There is no overloaded version of 'StrToInt64' that can be called with these arguments Why we get this error ? This error occurs when we attempt to call a overloaded function with invalid arguments or cannot be resol...

Formatsettings or TFormatSettings in Delphi

FormatSettings Formatsettings is a global variable of TFormatsettings record type in Delphi which is used to get local information's like DateTimeFormat, CurrencyFormat, DecimalSeparator etc. This variable was introduced in Delphi XE and before Delphi XE DateTimeFormat, DecimalSeparator, CurrencyFormat, etc. were declared as separate global variables in SysUtils.pas.   So when we migrate a Delphi project from old Delphi version to new Delphi version we generally get following errors and to solve this issue we need to use Formatsettings.DecimalSeparator.   Please visit my blog for more detail about such errors E2003 Undeclared identifier 'ShortDateFormat' error in Delphi XE3 or later versions Errors when we migrate a project from Delphi 7 to Delphi XE3 Undeclared identifier DecimalSeparator Undeclared identifier CurrencyFormat Undeclared identifier ThousandSeparator Undeclared identifier  DateSeparator Undeclared identifier ...