How to change Indy 8 IDMessage.pas with Delphi 6?

I have a copy of Delphi 6 and a simple email that uses the Indy TiDMessage component. I want to remove lines 464-465 from IdMessage.pas and then recompile the application. It’s hard for me to find clear documentation, so I tried the following steps to change the component:

  • open \ delphi6 \ source \ indy \ indy.dpk in the IDE
  • double-click the IdMessage.pas icon in the Package window
  • edited IdMessage.pas file and save the file
  • click Compile in Package Window
  • clicked Build Indy on the Project menu.
  • click Install in the package window

But then I get an error that \ bpl \ indy60.bpl cannot be downloaded because \ bin \ indy60.bpl is already loaded. So I tried "Install packages ..." in the "Components" menu, but only found \ bpl \ dclindy60.bpl. So I uninstalled this package and:

  • open \ delphi6 \ source \ indy \ dclindy.dpk in the IDE
  • click Compile in Package Window
  • clicked Building dclIndy in the project menu
  • click Install in the package window

All components were installed in the IDE (including IdMessage), but the email program still acts as if the original unmodified component is still in use.

What am I doing wrong?

+4
source share
1 answer

if you use runtime packages, you need to make sure that your program has detected a new batch .bpl file.

But you probably aren't using runtime packages. Thus, the runtime program statically links Indy code using .dcu files located in the Delphi installation folders. In particular, in this case, before <ProgramFiles>\Borland\Delphi6\Lib\IdMessage.dcu . You need to make sure you link the new code. The easiest way is to add the modified file to your project. This will mean that the modified version will be compiled and linked to your program.

Since your modifications are in the device implementation section, this is all you need to do. If the changes were in the interface section, you will encounter "Node X was compiled with Unit Y version errors." You would solve this by adding the rest of the Indy source to your project.

One point to emphasize is that you should never modify files in the Delphi installation folder. If you want to make modifications to these components, take copies of the files and make changes to these copies.

+5
source

All Articles