Unit to declare types

Hi all
I know this is a newbie question but Im trying to create a unit so that I can declare user defined data types etc and then declare that unit in a forms uses clause so I create an application wide set of custom data types

so I created the unit and saved it in my project

unit CTC_Types_Unit;



  • Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,*
  • System.Classes;*

Type // Declare a packed record of the master company

  • TCompanyDataPackedRecord1 = Packed Record*
  • CompanyID: Integer;*
  • CompanyName: string[100];*
  • ABN: string[50];*
  • Street: string[50];*
  • City: string[50];*
  • Country_State: string[50];*
  • Post_Code: string[10];*
  • Company_Type: Integer;*
  • Company_Status: Integer;*
  • Details_Changed: Boolean;*
  • end;*


*{$R .dfm}


But now when I declare it in a forms uses clause

Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus, Vcl.ExtCtrls, Vcl.ComCtrls,
Vcl.StdCtrls, CTC_Types_Unit;

the compiler complains with

[dcc32 Error] E1026 File not found: ‘CTC_Types_Unit.dfm’

so how do I resolve this

Thanks in advance and kind regards,

1 Like

Hi Grant

Try removing the

*{$R .dfm}

1 Like

That worked
Thank you