Chillibear
A place for notes about stuff

Delphi

Windows special folders

Useful Delphi function to obtain the various special folders from the Windows operating system (2k, XP, etc). You need to pass a folder ID integer in, the various enumerations of the special folders are listed in the comment block at the top of the code (e.g. CSIDL_STARTMENU). function GetSpecialFolder(FolderID: Integer) : String; { CSIDL_DESKTOP CSIDL_INTERNET [...]

IP addresses of the current machine

So how do you get a list of all the IP addresses bound to the local ethernet adapter? Easy use the built in global stack; GStack. All you need to do is add IdStack to your uses clause and your away! uses IdStack; … CheckListBox1.Clear; CheckListBox1.Items := GStack.LocalAddresses; CheckListBox1.Items.Insert(0, ’127.0.0.1′); Note that I’ve added the [...]

Invalid Delphi license

Just in case you ever get the same problem I sometimes get with Delphi 7… When you fire it up you get the following error message: Borland license information was found, but is not valid for Delphi. Then you need just do the following to clean up the registration settings which have become corrupt. Delete [...]

Current provider does not support returning multiple recordsets from a single execution” ADO exception and solution

Took me a while before I realised what I was doing wrong here, but it’s one of those silly things where it’s obvious once you know. I was trying to add a record to my database using the following code that I had based on code I was using to read records. ADOQuery1.Close; ADOQuery1.SQL.Clear; ADOQuery1.SQL.Add(‘INSERT [...]

DsgnIntf.dcu not found

Damn, and you really wanted to use that component? Well dsgnintf.pas is located in your {delphi}\Source\ToolsAPI\ directory, so you can add that to your library path, but if you’re compiling under Delphi 6 or 7 you’ve got a problem since the code that was originally in the dsgnintf.pas file is now split across several files. [...]