HowToDoThings.com
Register | Login
Home › Computers & Internet › Programming › Delphi

Delphi

Delphi may not be the most popular programming language out there, but we have a lot of great Delphi articles here for those diehard fanatics.

Purchase order lines

 
 
 
 
 
August 23, 2005
By Peter Morris
When creating an association in ECO you are not guaranteed the order in which the objects at the end of the association will be presented.  For this reason ECO provides a...

Application.ProcessMessages replacement

 
 
 
 
 
August 15, 2005
Not only is Application.ProcessMessages quite long to type, often extra functionality needs to be called when its used.  To this end I have created two basic wrappers which...

How to retrieve AutoInc Values with BDP in Delphi 2005

 
 
 
 
 
August 14, 2005
In this article I’ll use the term “Identity” interchangeably to note Auto generated (from RDMS) values usually for a column representing the primary key of a table. These...

Parameter exists

 
 
 
 
 
August 9, 2005
You will need the function in this article (http://www.howtodothings.com/ViewArticle.aspx?Article=760) to get this working properly function ParamExists(const ParamName: string):...

Get command line parameters

 
 
 
 
 
August 9, 2005
(* GetParameterValue GetParameterValue will return the value associated with a parameter name in the form of /paramname:paramvalue -paramname:paramvalue and /paramname -paramname ...

Get the size of a file

 
 
 
 
 
August 9, 2005
function GetFileSize(const FileName: string): Integer; var   sr: TSearchRec; begin   Result := 0;   if FindFirst(FileName, faAnyFile, sr) = 0 then   begin...

BaseForm class

 
 
 
 
 
August 9, 2005
Have you ever found yourself adding the same code to different forms?  Well now you can use the following as a base class for all forms. ===============   BEGIN...

MsgBox function

 
 
 
 
 
August 9, 2005
Personally I find both the WinAPI MessageBox and Application.MessageBox and MessageDlg functions cludgy and always add the following function to every app. function MsgBox(const...

Remove ReadOnly flag from file

 
 
 
 
 
August 9, 2005
The following function will attempt to remove the read only flag on a file, you will need the function in this article (http://www.howtodothings.com/ViewArticle.aspx?Article=755). ...

Detect if file is ReadOnly

 
 
 
 
 
August 9, 2005
The following function will return True if a file is read only. function IsReadOnly(const FileName: string): Boolean; var   sr: TSearchRec; begin   (* Assume not read...

How BoldTreeView works

 
 
 
 
 
August 3, 2005
By Peter Morris
This is just a quick set of instructions rather than a comprehensive article.  It is a copy of a posting I made in a Borland newsgroup... I'll give you an example of one...

Store and Retrieve a Bitmap in ECO

 
 
 
 
 
July 17, 2005
This article demonstrates the basics of how to store and retrieve a Bitmap in an ECO variable. First create an ECO variable in the class you wish to hold the bitmap, for example: ...

Two functions to evaluate OCL

 
 
 
 
 
June 27, 2005
With the help of Jonas Hogstrom and Jan Nordén I have written 2 functions to evaluate OCL.First is to evaluate OCL in EcoSpace:  public object EvaluateOclInEcoSpace(IElement...

Dynamic TableStyles Based on Object Type

 
 
 
 
 
April 21, 2005
Here is an example of using different TableStyles depending on the type of the currently selected object in a DataGrid. I have 2 grids, each hooked to ExpressionHandles. I...

Reading a tagged value

 
 
 
 
 
April 20, 2005
By Peter Morris
ECO allows you to add TaggedValues (name/value pair) to your model at design time.  Here is how to retrieve the value of a TaggedValue at runtime. obj.AsIObject() gives IObject...

ReEvaluate or ReSubscribe?

 
 
 
 
 
April 9, 2005
By Peter Morris
This article will explain derived members in ECO.  It's primary purpose is to describe the difference between the ReEvaluateSubscriber and ReSubscribeSubscriber parameters...

A Multi-Client-ECO application example.

 
 
 
 
 
April 9, 2005
The application we are going to build can be used for capturing worktime and breaks during the worktime. The worktime can be captured with multiple clients and the server application...

Turning on/off ECO logging

 
 
 
 
 
April 7, 2005
By Peter Morris
ECO II has a new feature in Update 2 which makes it easier to see what it is doing behind the scenes. When you run your app you can look in the messages window of the Delphi IDE...

Automatically setting the MaxLength in your GUI

 
 
 
 
 
March 15, 2005
By Peter Morris
As of D2005 udpate #2 there is a new helper class in the ECO framework named MaxLengthSupportFunctions. Normally when you databind an EditBox for example to an ECO object you...

Disabling multiplicity constraints

 
 
 
 
 
March 15, 2005
By Peter Morris
If you have ever tried reading constraints from an ECO model you have probably noticed by now that there are lots of auto-generated multiplicity constraints. I personally like...

Evaluating constraints

 
 
 
 
 
February 26, 2005
By Peter Morris
Before updating the database with changes to your objects it is wise to check that the object is in a valid state first.  ECO allows you to model constraints against your...

Sending HTML emails with ICS

 
 
 
 
 
February 10, 2005
procedure THtmlMailForm.SendButtonClick(Sender: TObject);begin if FRunning then begin MessageBeep(MB_OK); Display('**** ALREADY RUNNING ****'); Exit; end; FRunning := TRUE; try {...

Evaluating in-database OCL in code

 
 
 
 
 
February 10, 2005
By Peter Morris
In a form etc we can evaluate OCL in the DB by using an OclPSHandle, but how do you evaluate OCL in the DB in code? This tip thanks to Jan Norden from Borland. IOclService oclService...

Code derived associations

 
 
 
 
 
February 1, 2005
This article will demonstrate how to use code derived associations to implement user-defined class constraints. Code derived association is derived association without provided...

D4: Making TCheckbox Data Aware with TDBEdit

 
 
 
 
 
January 3, 2005
Simple means of making some components data-aware. Alternative data-aware checkboxes (and radiobuttons) that can be arranged more flexibly. Although more recent versions of Delphi...

ECO2 Expression Handles and the ASP.NET Repeater Control

 
 
 
 
 
January 3, 2005
By Scott Price
How do we databind the information from the ExpressionHandle or other handle type into the ASP.NET Repeater control? Took a little double take viewing, but Pete Morris kindly...

Composition is much better than inheritance

 
 
 
 
 
December 10, 2004
By Peter Morris
This article explains the pitfalls of inheritance, and offers a solution... In this article I will have to use some ficticious class names etc due to the sensitivity of the project...

Composition and recursive OCL

 
 
 
 
 
December 9, 2004
By Peter Morris
This article demonstrates a simple example of using recusive OCL within a composite pattern. "To understand recursion we must first understand recursion" [Source unknown] Surely...

Code Derived Columns in ECO II

 
 
 
 
 
December 3, 2004
By Peter Morris
Explains what Code Derived Columns are, and how to use them. The focus of this article will be "Event derived columns".  Jan Nordén (Borland) pointed me in...

Tidy Component Library for Easy Migrations or Builds

 
 
 
 
 
November 15, 2004
By Scott Price
Controlling your Library Path can be benefitial for a number of reasons, easy reading, sharing network components/libraries, or even for escrowing projects. There is a relatively...

Windows Search Engine

 
 
 
 
 
November 7, 2004
Implementing Shell Search Handler using Delphi The Shell supports several search utilities that allow users to locate namespace objects such as files or printers. You can create...

How to store the contents of a RichEdit in an EMF files

 
 
 
 
 
September 14, 2004
Howto store the contents of a RichEdit in an EMF files Sometimes, you may want to store the contents of a rich edit control in a metafile. This article outlines an approach that...

Changing Left and Right channel volumes separately:

 
 
 
 
 
August 23, 2004
This article describes a simple way to set left and right channel volumes separately. Changing Left and Right channel volumes separately: By : Pooia LalbakhshMS in Computer Engineering These...

Sending HTML emails with Indy

 
 
 
 
 
August 10, 2004
By Peter Morris
This example shows how to send HTML emails using Delphi and Indy, with embedded images. uses  idMessage;procedure TForm1.Button1Click(Sender: TObject);var  html: TStrings; ...

Password Authentication

 
 
 
 
 
July 9, 2004
Password authentication is used in many systems for authenticating the identity of one or both peers of a connection. This paper will help you design more secure password authentication...

Fast Refactoring with Castalia

 
 
 
 
 
May 20, 2004
Refactoring is the process of "improving the design of existing code." Learn how to become a faster and more productive refactorer with Castalia. This is the fourth...

COM and Windows Services

 
 
 
 
 
May 19, 2004
By Peter Morris
A little tip on using COM with Windows Services. Today I tried accessing an XML document from a Windows service.  When I prototyped my classes using a Windows forms app everything...

How to reduce time spent finding errors

 
 
 
 
 
May 13, 2004
Learn about the various error finding habits of Delphi developers and how you can overcome bad habits to find errors faster and more efficiently (Originally published at delphi-expert.com...

How to reduce development time by reducing keystrokes

 
 
 
 
 
May 13, 2004
This article discusses observations on how the most effective developers are able to cut the amount of typing they do nearly in half and gives recommendations on how you can experience...

How to navigate through your code faster

 
 
 
 
 
May 13, 2004
This article teaches techniques developers can use to navigate code faster and comprehend it better. (Originally published at delphi-expert.com on May 14, 2004) This is the third...

Using try..except to handle errors

 
 
 
 
 
May 13, 2004
Learn about exceptions and how to write better error handling code. Learn how Castalia can help us write more robust and fault tolerant code. (Originally published at delphi-expert.com...

How to automatically split temporary variables in Delphi

 
 
 
 
 
May 13, 2004
This article discusses proper usage of temporary variables, motivations for splitting improper variables, and how to use Castalia to automatically split them. I would like to address...

Using try...finally to avoid resource leaks

 
 
 
 
 
May 13, 2004
This article discusses Delphi's try..finally construct, when to use, and how Castalia makes it easier to use. (Originally published at delphi-expert.com on March 16, 2004) In a...

Tutorial: Write your own FindFiles tool

 
 
 
 
 
May 11, 2004
How to use FindFirst and FindNext with recursion, for adding filenames and paths to a stringlist How to create a list of the files in a folder and its subfolders In the following...

Role based programming in Bold

 
 
 
 
 
May 3, 2004
By Peter Morris
An example of implementing the Actor/Role pattern in Bold. Role based programming in Bold Bold allows developers to develop OOP applications which persist to a database. This gives...

How to make a TEdit numeric

 
 
 
 
 
April 27, 2004
By Peter Morris
A small tip showing how to tell windows that your Edit control should only allow numeric entry. If you need a Windows Edit control to only accept valid numbers, but don't want...

How to detect if diskdrive contains a floppy

 
 
 
 
 
April 19, 2004
This article explains how to detect if a diskette is in the disk drive on NT based systems (w2k, XP)Windows has the habit of requesting the user to insert a floppy. Normally this...

Invoking the windows Browse For Folder dialog

 
 
 
 
 
March 16, 2004
By Peter Morris
Borland's SelectDirectory browser is quite ugly, here is how to invoke the Windows one instead.uses   ShlObj, ShellAPI; ...... function BrowseForFolder(handle : HWND;...

How to use DNS blocklists to detect spam

 
 
 
 
 
March 12, 2004
One of the solutions to spam is a -frequent updated- database with IP addresses that appear to misbehave. This database should, preferably, be random accessible at high speed....

Persistent derived attributes

 
 
 
 
 
February 26, 2004
By Peter Morris
A small example of making derived attributes which are persisted to the database.Persistent derived attributes in Bold Bold's derived attributes are always evaluated in memory,...
12345678next ›last »
About Us | Privacy Policy | Terms & Conditions | Discussion Board | Sitemap | FAQs | Contact Us
Copyright © 2008, How To Do Things - All Rights Reserved
  • Home
  • Browse All Categories

Computers & Internet

  • Databases
  • Hardware
  • Internet
  • Networking
  • Programming
    • Delphi
    • Other
  • Software