XE2 version of Delphi can finally generate 64bit applications.
We have succeeded in creating a Delphi 64bit example-application for our 64bit version of the Cut2DX. Previously we have integrated our component in 64bit applications created with Visual Studio (C#, C++ and VB).
Delphi XE2 IDE is a 32 bit application. Because of that you cannot install a 64bit component in the Component Palette. So, this time, you cannot drag the component as you did in the previous editions of Delphi. Instead, you have to manually create an instance of the component at the runtime.
So, here the are steps:
1. Make sure that 64bit edition was previously registered with regsvr32.exe (the one located in system32 folder!).
2. Create a VCL based application.
3. From Project Manager (located in the right side of the screen), right click the Target Platforms, choose Add Platform | 64 bit Windows.
4. From menu Component select Import Component | Type library.
5. From the list of registered type libraries, select optimal2dx_64Lib, then next.
6. No need to specify a Palette page, because anyway the component will not appear there.
7. Add unit to the current project. Finish.
8. Add optimal2dx_64Lib_TLB to the list of units used the current project.
9. Declare a variable: cut2d64: TCut2DX.
10. Create an instance of TCut2DX during the FormCreate event:
cut2d64 := TCut2DX.Create(Form1);
11. Create 2 event handlers for OnFinish and OnProgress events. Add the declarations in the interface:
procedure OnFinish(Sender: TObject);
procedure OnProgress(Sender: TObject);
12. Implement them as you need:
procedure TForm1.OnFinish(Sender: TObject);
13. Assign the handlers to the current instance. You may do this just after you have created the instance:
cut2d64.OnFinish := OnFinish;
cut2d64.OnProgress := OnProgress;
14. Destroy the instance of TCut2DX during the OnClose event of the form: