2
votes

I installed DCPCrypt on Delphi 2010. I opened the Delphi2009.dpk, compiled it and then used the Component->Install Packages and then pressed "Add". I browsed through the DCPDelphi2009.bpl and the component showed on the next restart. But then, when I try this:

function TForm1.EncryptThis(aString : string) : string;
var
   Cipher: TDCP_cast256;
   KeyStr: string;
 begin
   KeyStr:= 'AcceleratedKeyString';
   Cipher:= TDCP_cast256.Create(Self);
   Cipher.InitStr(KeyStr,TDCP_sha1);
   result := Cipher.EncryptString(aString);
   Cipher.Burn;
   Cipher.Free;
end;

It outputs the following error:

[DCC Fatal Error] Unit1.pas(7): F1026 File not found: 'DCPCAST256.dcu'.

I think I could fix this by copying the DCU file to my project's directory but I'd have to do that in every project?

When I open a .dpk file, it does not prompts me with an "Install" option. And if that can help, when I go to "Install Packages", if I press the edit button I get this: Unable to edit package "blablabla.bpl. The source could not be found.

And that, on any packages including those that come with Delphi. This is for an in-house app.

1

1 Answers

3
votes

Add the folder containing the dcu's to the Delphi library path in Tools/Options/Delphi Options/Library.

You may also want to add the folder containing the pas files to the Browsing path in that same dialog if you want to reach the source code in the IDE, for example using Ctrl+click.

To avoid confusion, you may also want to rename the package to DCPDelphi2010.dpk before compiling and installing it to the IDE. That way you will get also a DCPDelphi2010.bpl.

I look weird to have a package named 2009 installed in the 2010 IDE.