Click here to Skip to main content
15,867,686 members
Everything / Programming Languages / Delphi

Delphi

Delphi

Great Reads

by Chad Z. Hower aka Kudzu
Delphi has some big gotchas with interfaces. Learn how to bypass them.
by ADMGNS
An alternative method to Catmull-Rom, Chaikin or Bezier curve smoothing methods
by Issam Ali
How to pass native (Delphi) callback pointer to a .net COM assembly
by Denis Murashov
In the article I describe the possibilities of standard Delphi DFM-serialization mechanism. I start from the basics and then try to cover more complex situations.

Latest Articles

by ADMGNS
A new method for 2D polyline simplification and also smoothing that alternative to Douglas-Peucker and curvature-based simplification algorithms
by ADMGNS
Very simple, noise-based color visual cryptography for images
by Max Kleiner
We use a Command Line Interface with OpenWeatherMap (PyOWM) to make it easier to use the OpenWeatherMap API in Python.
by ADMGNS
An alternative method to Catmull-Rom, Chaikin or Bezier curve smoothing methods

All Articles

Sort by Score

Delphi 

12 Jul 2018 by Chad Z. Hower aka Kudzu
Delphi has some big gotchas with interfaces. Learn how to bypass them.
30 Apr 2021 by ADMGNS
An alternative method to Catmull-Rom, Chaikin or Bezier curve smoothing methods
26 Apr 2012 by Issam Ali
How to pass native (Delphi) callback pointer to a .net COM assembly
5 Dec 2015 by Denis Murashov
In the article I describe the possibilities of standard Delphi DFM-serialization mechanism. I start from the basics and then try to cover more complex situations.
11 Nov 2010 by CPallini
You probably need a C# wrapper class around Win32 INI file API. Have a look at this CodeProject's article: "An INI file handling class using C#"[^].
6 Feb 2011 by Espen Harlinn
Seems like Google is your friend[^]In addition - anything you can do in c, can easily be ported to Delphi. Microfocus provides a lot of sample applications ... now there is also the RUMBA Developer Edition .NET (RDE .NET) - you can use this with Prism (Delphi for .Net). RegardsEspen...
4 Jan 2013 by Vyacheslav Voronenko
Proof of concept way for Delphi developers to go mobile development with Firemonkey framework
21 Mar 2013 by Espen Harlinn
Assuming you're using Visual C++, you could use COM, here is a pretty nice tutorial: A Beginner Tutorial for Writing Simple COM/ATL DLL For VS2012[^]Delphi works pretty well with COM, so accessing the COM object should be quite easy.Best regardsEspen Harlinn
12 Dec 2014 by Yuriy Magurdumov
Calling native methods from .NET application via standard Windows Named Pipes
6 Aug 2022 by ADMGNS
A new method for 2D polyline simplification and also smoothing that alternative to Douglas-Peucker and curvature-based simplification algorithms
8 Aug 2010 by DABBee
You dont really mean you want the assembly code do you. Surely you meant to say something else - please check your question - look up what assembly code is, I suspect you are not clear on this.NOP
8 Aug 2010 by Sauro Viti
"tracking code from live camera is a vague sentence, but I suspect that there is a lot of work under the scene: if you can do the work using C/C++, why do you want to do it using assembler? It could be a titanic work, hard to do, error prone, and difficult to debug!
18 Aug 2010 by Niklas L
I think you should focus on the design/technique used instead. Then the choice of language will follow; which language/IDE supplies a sufficient framework, how are you planning on debugging your application, what are you comfortable with, etc. I would not recommend writing your own protocol for...
21 Mar 2013 by Matthew Faithfull
If you have the source to both parts, C++ and Delphi and you build both with C++ Builder/Rad Studio then you can call the C++ code from the Delphi and the other way around too. In that case you could do what you want with a callback. You pass the address of a Delphi function into the C++ as a...
19 Apr 2013 by Sergey Alexandrovich Kryukov
Apparently, PWideChar.Please start here: http://delphi.about.com/od/objectpascalide/a/understanding-unicode-support-in-delphi.htm[^].—SA
6 Jan 2014 by CHill60
As the OP's solution will no doubt be deleted shortly I'm posting my comment as a solution - given the thank you I presume it workedQuote:That doesn't look like any Delphi code I've seen - which granted isn't a huge amount. You are assigning 0 to combobox5.itemindex and then adding two...
23 Nov 2014 by Sergey Alexandrovich Kryukov
Not only you need to include combo box types, but also the types derived from it, or, more likely, from StdCtrls.TCustomComboBox or, say, StdCtrls.TCustomCombo:http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/StdCtrls_TComboBox.html[^].In...
4 Nov 2015 by Denis Murashov
In the article I try to make a brief review over methods to manage object lifetime in Delphi applications.
7 Nov 2015 by Denis Murashov
The article is step-by-step tutorial on how to make changes in standard Delphi libraries.
18 Feb 2016 by CPallini
Your list of 'musts' throws out anything (at least in mainstream languages) but C++, in my opinion.
7 Feb 2017 by hamdenvogel
Learn how to implement a real stream file based dataset descendant with blob support and much more
25 Apr 2010 by Kristian Sixhøj
I think this is what you're looking for:Steganography - Hiding messages in the Noise of a Picture[^]There's plenty of articles on this subject here on CP, just search for them.
11 Nov 2010 by Sauro Viti
I think that TIniFile doesn't corresponds to FileStream: probably it is related to the old .ini files which are deprecated and not directly supported in the .NET Framework.However you can access them using the P/Invoke; the Win32 API that you need is GetPrivateProfileInt[^]
3 Jun 2011 by Alexey Merson
If you have a SOAP server created with Borland Delphi and a SOAP client created with .NET, then you can't get it working out of the box.
5 Oct 2011 by Mario Majčica
OOP is not an thing that you will use. Instead is an programming paradigm which needs to be supported by the programming language you are using. As far as I know Delphi is an object-oriented derivatives of Pascal, so yes you are probably already programming by this paradigm.Here you can find...
8 Dec 2011 by nadigatlatulasirao
I am working on delphi.In my project i want provide end user to create controls at runtime (like button).I must give the control to end user,so he has the ability to change the name or caption of the created control at runtime.i can create the controls at runtime.I am unable to change their...
28 Jun 2012 by Winston_D
Someone showed me that there was just one small key that I didn't do. The code:Note that ResultForm may be declared as an global variable of TResultForm or as a local variable. Not yet sure if a difference arrises later though.procedure TMainForm.Button1Click(Sender: TObject);begin ...
17 Oct 2012 by Valery Possoz
Hello,Actually it is possible if you use the [code] section and write your own code.[Code]function CreateBatch(): boolean;var fileName : string; lines : TArrayOfString;begin Result := true; fileName := ExpandConstant('{pf}\{#MyAppName}\batch.bat'); ...
23 Dec 2012 by User 8984948
I want to give a fairly simple Delphi example that will expose the dependency injection pattern.
14 Apr 2013 by Abhinav S
To convert from decimal to hex, simply try string hexValue = value.ToString("X");.
11 Jan 2014 by CPallini
You might use, for instance, Visual C++, either for creating a console application or a GUI one.A GUI application written using WINAPI would have a pretty small executable with minimal additional dependecies (see, for instance "Deployment in Visual C++"[^]).
10 Nov 2015 by F-ES Sitecore
If someone provided cloud web services with 24\7 availability for free then how would they make money? Who would pay for web hosting? Why would a company spend millions and millions in hardware infrastructure and not charge anyone to use it? When the cables break, or the hard drives need...
19 Jan 2016 by Sergey Alexandrovich Kryukov
You have to write code from scratch, following the same logic. The class you need is System.IO.Ports.SerialPort:SerialPort Class (System.IO.Ports)[^].—SA
9 Aug 2016 by Richard Deeming
It sounds like you're looking for the FileExists function[^]:if sStudent = ''thenbegin Application.MessageBox('No data has been inputed. Please Input a name to search', 'Error no information to search', 0);endelse if Not FileExists('Students\' + sStudent + '.zip')thenbegin...
21 Jul 2018 by ThatsAlok
Let's explore Flutter Grid view and MediaQuery
27 Feb 2010 by RichardM1
I googled 'delphi usb control'Here is the second hit.http://www.sixca.com/eng/articles/usbstepping/[^]Torry.com is your friend, so is delphi3000.com.There are LOTS of delphi USB components out there:Get familiar with torry.com and their search[^]Get familiar with delphi 3000...
12 Mar 2010 by DaveAuld
See this excellent Article from Sacha Barber here on code project;SQL Database Image Storage & Easy Thumbnails[^]It should give you an excellent start!
25 Apr 2010 by #realJSOP
You want to google the word "steganography".
20 Jul 2010 by E.F. Nijboer
You should check in the OnClick event if the click was realy on an icon. Below an example.procedure TForm1.TreeView1Click(Sender: TObject);var P:TPoint;begin GetCursorPos(P); P := TreeView1.ScreenToClient(P); if (htOnStateIcon in ...
18 Aug 2010 by Aescleal
If it's a traditonal "thick client" connecting to a central database I'd give RealBASIC[^] (or as it's called these days, RealStudio) a look. It can connect over ODBC to databases, is quite a nice OO language under the covers and you can interface it to C if you need something with a bit of...
18 Aug 2010 by Dylan Morley
Languague doesn't matter so much - they're just different tools to accomplish a job. What matters is how the users are expecting to work, your infrastructure and networkIf you go with some sort of web interface, you only need to design a site that has access to the database then expose the...
20 Aug 2010 by Aescleal
I know nothing about Delphi but are you sure it can cope with a reference parameter? None of the other languages I use regularly (Java, Python) can handle C++ references so it might be same for Delphi and that's what's causing the problem.Cheers,Ash
11 Nov 2010 by Member 4581741
Can any one help me to convert this delphi code to C#. class function TShrinkConfig.MyVersion: WORD;varini: TIniFile;beginini := TIniFile.Create(gsIniFile);Result := ini.ReadInteger(SHRINK_INI_SETUP_SECTION,SHRINK_INI_MYVERSION,SHRINK_INI_VERSION_1);ini.Free;end;if...
11 Nov 2010 by Toli Cuturicu
http://www.cod...
29 Nov 2010 by Indivara
There's a sample on MSDN. Seek and ye shall find.
20 Dec 2010 by nortee
Hello,I've found that using the Indy components that come with Delphi work quite nicely for anything to do with socket programming. There are a few demos that come with it as well including emailing, FTP, TCP/IP and more. If your version of Delphi does not have these demos you should be able...
11 Jan 2011 by Espen Harlinn
By guessing wildly I would say you are trying to implement an incremental search through the elements of the tree.Virtual Treeview component[^] does that so well that reimplementing it using the standard "slow" TreeView is a vaste of time.Virtual Treeview really is a gem, it's a total...
9 Feb 2011 by OriginalGriff
Looks like it is a Single rather than a double.Section 1.2 sort of suggests that: http://ultrastardeluxe.xtremeweb-hosting.net/wiki/doku.php?id=development:c_header_conversion[^]
27 Mar 2011 by Dave Kreskowiak
You need to go here[^] and ask the people who wrote the indy9 library.
21 Apr 2011 by Henry Minute
Delphi is now owned by Embarcadero so the best place to look would be their site[^].
5 Oct 2011 by Sergey Alexandrovich Kryukov
Delphi is a derivative of Object Pascal, a derivative of Borland Turbo Pascal, also very much object-oriented. As to Delphi, this is one of the most advanced object-oriented languages and libraries, some features are more advanced than that of .NET (and some are less).Finally, Delphi is the...
14 Oct 2011 by AspDotNetDev
Use the Google Custom Search API.
20 Nov 2011 by Takso
Dynamically create a Stored Procedure to add a column when it does not exist.
2 Dec 2011 by jschell
Please explain your question in more detail.The file exists on which OS?Which OS does the file need to move to?One which OS, of the two above, does the app run on?When you say it is "not happening" is there any other information such a there is a file but it is empty, or there is an...
6 Dec 2011 by Mashinchi
Hi, I think that platform not matter for you. all of them support Server/Client applications but if you want to develop windows application you can use multi or 3 tiered applications and use COM+ technology to connect to your server remotely. For more information you can use Delphi 3tire...
8 Dec 2011 by Sergey Alexandrovich Kryukov
You need to understand that your properties are actually changed during run time anyway when you run your application, based on form data (made by designer) or not — it does not matter.You also need to read about properties and understand how they work. In brief, they are methods...
8 Dec 2011 by Amir Mahfoozi
Their names are only useful in design time not runtime. When you create controls dynamically you can assign an object to it with a lot of data embedded in it(so obviously a name can be linked to that object). Also it can be reverse I mean that you can store a list of objects that have their...
24 Dec 2011 by Mashinchi
Hi, for your problem i can say you that when you create a control on runtime, delphi set the control's name with blank. So you can set a name to your control with this example:myControl.Name := 'myControlName'; So after that if you want to work with your created control on runtime you...
27 Dec 2011 by Wendelius
Did you try to Google[^]? Lots of potential hits, like:- http://mc-computing.com/languages/delphi/images.html[^]- http://www.delphidabbler.com/tips/21[^] and so on...
13 Apr 2012 by Misol1
Hello all, We started to encounter a bizzare problem with TAdvGlassButton buttons from TMS Software under Delphi2007. Sometimes they simply do not show, and if so, then all of them, across whole application. The point is, that the buttons are there, they react to events (you have to know...
26 May 2012 by CPallini
There is the CodeProject's article: Computer Vision Applications with C# - Fuzzy C-means Clustering[^]. It is C# instead of Delphi, but, I suppose, that is a minor problem.
30 Jun 2012 by DamithSL
procedure MergeStrings(Dest, Source: TStrings) ;var j : integer;begin for j := 0 to -1 + Source.Count do if Dest.IndexOf(Source[j]) = -1 then Dest.Add(Source[j]) ;end;http://delphi.about.com/cs/adptips2003/a/bltip0703_4.htm[^]
25 Sep 2012 by Maciej Los
The WHERE condition should looks like:WHERE [Name] = N'Samuel'So, you need to use a ' twice, for example://declare variable to store SQL commandsSQL: string;//set the valuesSQL := 'SELECT * FROM my_table WHERE my_name = N'':my_name_p''';ADOQuery.SQL.text :=...
28 Dec 2012 by User 8984948
A working example of the Template Method design pattern in Delphi
5 Feb 2013 by erfan mirtabatabai
How Can I Add Data(String type or integer and ...) To 'TStringList' From a 'TextFile'and then Count the same Data(this=5, or=3 ,123=12 for example) at last show into the 'ListBox' or 'TextBox' something like that,Please help me anyone who knows Delphi well.
1 Apr 2013 by iDebD
C++ DLL: "MyDll.dll"/////////////////////////////////////////////////////typedef HRESULT (CALLBACK * CALLBACKPROC)(DWORD wEvent,LONG_PTR arg,PVOID pParam);/////////////////////////////////////////////////////CALLBACKPROC g_pCallback = NULL;LPVOID g_pCallbackParam =...
12 Jun 2013 by wedagedara
I have solve that myself by pressing insert key.
27 Aug 2013 by Richard MacCutchan
You should learn to read the error messages and correct the issues they are identifying for you.For example:at line 18 you have a type error - have you defined Result?at line 25 you have a semi-colon in the wrong place.at line 30 you have a string that does not have a terminating quote...
1 Dec 2013 by CPallini
You should choose the one you are more comfortable with. Both of them are good choices.
1 Dec 2013 by CHill60
Trouble with posting a question like this in Quick answers is that once you have one "answer" then your question drops out of the list and not many people will view it.You might be better off posting it in one of the General Programming forums as it is really about a discussion rather than a...
5 Jan 2014 by Espen Harlinn
Have a look at: https://code.google.com/p/siapen/[^]You'll find VFrames.pas[^] if you dig into the code.[Update]1. Get raw data from ACM 2. Write the data to a MemoryStream3. Send the MemoryStream using Indy. Somthing similar to this:with Owner.PeerThread.Connection do ...
11 Jan 2014 by Captain Price
Well, you have to program directly to the operating system's API. This API is system-specific. On windows it is the Windows API. The Windows API is written in pure C.A "Hello-World" of the Windows API (AKA, Win32 API)://"Hello-World" application#include LRESULT CALLBACK...
24 May 2014 by Rian.eka.cahya
I have code in delphi 7 with a commponent indy in Event OnExecute...but when I implemented in Delphi XE5,I have an error.Code Event OnExecute component indy IdMappedPortTCP in delphi 7 :procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);if...
3 Jun 2014 by E.F. Nijboer
It wouldn't strengthen it. The reason for the random salt is to prevent creating a rainbow table. If you use a derived salt you would weaken the encryption. For example, it would render the result of GetSalt("Foo") to be "Bar". But it would always be "Bar"! There is nothing random about...
19 Aug 2014 by Richard MacCutchan
Why have you posted this message here? I already told you that you need to post it in the forum at the end of the article.
9 Nov 2015 by OriginalGriff
Any PHP web hosting company should give you "50MB of space", but finding a free one that is available 24/7 is trickier - most of them will not guarantee uptime unless (or even if) you pay for the service, and that is understandable. I have tried a few "free" services in the past and they were...
11 Nov 2015 by Dave Kreskowiak
You question is confusing. You say you wrote a Service application. Service apps start without anyone logging into the machine. They start when Windows starts, not when someone logs in. There is NEVER an interface that appears when someone logs in asking whether to run it as an administrator or...
21 Nov 2015 by Denis Murashov
In the article I describe an approach to handle COM-server unloading issues using smart pointers.
21 Nov 2015 by Denis Murashov
In the article I describe an approach to handle COM-server unloading issues using smart pointers.
21 Nov 2015 by Denis Murashov
In the article I describe an approach to handle COM-server unloading issues using smart pointers.
21 Nov 2015 by Denis Murashov
In the article I describe an approach to handle COM-server unloading issues using smart pointers.
2 Jan 2016 by Matt Comb
uses Windows, PsAPI, SysUtils;const SE_SECURITY_NAME = 'SeSecurityPrivilege'; PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = $00020000; EXTENDED_STARTUPINFO_PRESENT = $00080000;type PPROC_THREAD_ATTRIBUTE_LIST = Pointer; STARTUPINFOEX = packed...
2 Feb 2016 by CPallini
See, for instance, this: "Calling a Delphi method in a dll from c# - Stack Overflow"[^].
18 Feb 2016 by Jochen Arndt
Why you are using some kind of DLL to access an USB mouse instead of using the Delphi mouse events that use the Windows API?The mcHID DLL is for accessing USB devices on a low level.I have not used Delphi so far, but a quick research shows that there is an OnMouseMove event. If you need...
15 Mar 2016 by fourti_nabil
for those who may have the same problem and who ara interested; following the sample code fro working project : project to generate delphi DLL and export class instance : DDLL.zip - Google Drive[^]C++ project to use delphi DLL (2 version Static and Dynamic loading): DDLLUSERv2.zip - Google...
3 May 2016 by Jochen Arndt
It seems that with Windows XP the file search functions (Windows API functions FindFirstFile, FindFirstFileEx) will lock the directory.As a result the directory which is searched can't be deleted while the search handle has not been closed (like a file that is actually opened can't be...
4 Aug 2016 by Richard Deeming
I haven't touched Delphi in years, but I'd assume that if sStudent ' ' will execute everything inside the if block unless the textbox contains a single space. So if you leave it empty, or type in anything other than a single space, the message will be shown.You probably also want to move...
7 Sep 2016 by MattTelles
Look at:AssignFile(E, 'Config\list.txt');Is there a "Config" subdirectory in the current directory in which the executable is running? I bet not.
9 Sep 2016 by Patrice T
Quote:Reason being is my code worked and now its stopped, It was rather spontaneous, The program works, as in the data is stored on the clipboard, But it doesnt write the text filesIf it was working and stopped, it is linked to the data, use the debugger to see what is going on.You should...
16 Sep 2016 by Dave Kreskowiak
Get used to it. Everything is going to have some kind of runtime you have to install to get it to work. Be it the C#, VB.NET, C/C++, ... except for Assembler. Good luck learning that one.Your problem is that you're targeting Windows XP, which hasn't been supported for years now. Newer stuff...
31 Dec 2017 by OriginalGriff
No. Firstly because C# is ... well, C# ... and Delphi is Pascal based, a language with similar roots, but which is not related in any practical way. Second because C# requires the .NET framework to do anything, the two are very closely related. Delphi does not support .NET - although you can...
23 Feb 2018 by Maciej Los
Check this: How open a url with http authentication in Delphi? - Stack Overflow[^] http - How to add a "Authorization=Bearer" header with Indy in Delphi? - Stack Overflow[^]
27 Mar 2018 by Jochen Arndt
See delphi - Midas.dll error loading midas.dll - Stack Overflow[^] Or add the unit MidasLib to the uses clause of your code to link statically. Then you don't need to install the DLL on clients. See Deploying Applications that use ClientDataSets[^].
29 May 2018 by OriginalGriff
As far as I know, you can't prevent any application - let alone all of them - from accessing the clipboard at any time. That's kind of the point - the clipboard is a data exchange area for the user, not for applications. If you are using the clipboard as an inter-process communications channel,...
29 May 2018 by Jochen Arndt
Your code uses the clipboard viewer chain to get notified about clipboard change events and misuses that to prevent other applications that have registered themself to the chain from being notified. But that solution has three drawbacks: The clipboard can be accessed by any application at any...
22 Aug 2018 by Jochen Arndt
You just have to know about the SQL syntax. As already mentioned by digimanus you can use AND within WHERE clauses. But you should use parametrised queries to avoid SQL injection - Wikipedia[^] when the data has been entered by users. Such allow also passing data by value instead of string...
2 Feb 2019 by CHill60
You are adding extra items instead of passing the stuff as columns. See this example SwissDelphiCenter.ch : ...show Columns in a TListBox using Tabulators of different widths?[^] Once you have set up your tabulators you should be adding your data like this:...
11 Jul 2020 by Richard MacCutchan
See startup add - Google Search[^].
8 Sep 2020 by Maciej Los
A proper place to post such of content is here: Bugs and Suggestions[^]