![]() |
Unit ohne Formular
Hi Leute,
ich habe eine Unit ohne Formular erstellt. Eine einfache Unit3 eben. In dieser Unit ist eine Klasse TCalc enthalten. Bei der Übersetzung aber, meldet der Compiler >> [Error] File not found: 'Unit3.dfm' <<. Könnt ihr mir sagen, was die Ursache ist? Danke für Eure Hilfe. xthing |
Re: Unit ohne Formular
Du musst im Projectfile die Unit mit Formular löschen und nur über uses (in der unit mit dem Aufruf)einfügen.
|
Re: Unit ohne Formular
@EDatabaseError
Hi, danke , das habe ich gemacht. Funktioniert aber trotzdem nicht. Mein Projektfile sieht so aus:
Delphi-Quellcode:
Was muss ich nun, wo ändern?
program Project1;
uses Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {DataModule2: TDataModule}, Unit3, Unit4, Unit5; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.CreateForm(TDataModule2, DataModule2); Application.Run; end. Danke noch mal. xthing |
Re: Unit ohne Formular
Hi,
es müsste so in der Art ausschauen:
Delphi-Quellcode:
'Unit3.pas' benötigst du im Projekt-Quelltext natürlich auch. Woher soll Delphi sonst wissen, was deine Unit 3 ist? ;)
program Project1;
uses Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2}, Unit3 in 'Unit3.pas'; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm2, Form2); Application.Run; end. Doch eigentlich macht Delphi das automatisch. |
Re: Unit ohne Formular
Geh doch einfach auf "Datei"->"Neu"->"Unit" und kopier in diese neue Unit dein Quelltext rein ;)
Kann es sein das du einen neue Form erstelt hast un da einfach das TForm rausgelöscht hast? |
Re: Unit ohne Formular
Danke, Ihr habt mir geholfen...
Xthing |
Re: Unit ohne Formular
@Matze: hä? Warum sollte man den Dateinamen angeben? Schliesslich ist der Unitname entscheidend und der endet nunmal auf .pas.
Und er verlangt die DFM, wenn ein Compilerdefine zur Einbindung von dieser noch in der Unit ist:
Delphi-Quellcode:
. Dies kommt vor allem vor, wenn die Form nachträglich aus der Unit rausgelöscht wurde - wie schon vermutet.
{$R *.dfm}
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:21 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz