1

i have this problem; i need call filectrl unit in a my unit. Of course, i do: uses filectrl in interface section but it not is detected. I have tried too with system.filectrl but not found too this. I have searched in help (online and local) but there is wrote that unit is correct. I use delphi xe2, too you have same problem? Have solved it? If yes as you done? Thanks very much.

Marcello Impastato
  • 2,263
  • 5
  • 30
  • 52

3 Answers3

7

The full name of this unit in Delphi XE2 is:

uses VCL.FileCtrl;
Ville Krumlinde
  • 7,021
  • 1
  • 33
  • 41
5

The scoped name you need is Vcl.FileCtrl.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Ouch. Does that mean that Delphi 2010 code doesn't compile with XE without changes? Are there a lot of changes one has to make? – RobertFrank Sep 14 '11 at 12:52
  • You can use project settings to mitigate the pain, so I believe. I've no personal experience. As I understand it, an old project, when migrated, is configured so that the unit scopes are implicit. However, I think it will be wise to move away from that legacy mode. – David Heffernan Sep 14 '11 at 12:58
  • @Robert, what David describes seems similar to the "unit aliases" setting employed in the transition from version 1 to 2. It made it possible to continue compiling code that used WinTypes and WinProcs instead of the single unifying Windows unit. – Rob Kennedy Sep 14 '11 at 15:12
  • @Rob Exactly, from what I have read it is very similar indeed. – David Heffernan Sep 14 '11 at 15:13
  • There have been *Default namespace* and *Namespace prefixes* settings in the project options since D2005 or D2006, IIRC, but probably no one used that, except for .NET. – Rudy Velthuis Sep 14 '11 at 21:02
  • @Robert - The IDE will attempt to add appropriate unit scope prefixes (VCL, Data, Web, etc), based on the contents of the project when it does the upgrade the first time it's opened. There may be cases where some prefixes are not automatically added. Of course, if the project is being compiled from the command line it's not going to work either. – Mark Edington Sep 15 '11 at 05:20
3

You can either use Vcl.FileCtrl, as others have already written, or you can add Vcl to the Namespace prefixes in the project options. The ellipsis button for that shows an editor for such prefixes. To be like XE, you can e.g. add System, Vcl and Winapi as prefix.

But I would only do the latter (Namespace prefixes) if I were using old code.

Rudy Velthuis
  • 28,387
  • 5
  • 46
  • 94