AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Unit ohne Formular

Ein Thema von xthing · begonnen am 28. Jun 2006 · letzter Beitrag vom 30. Jun 2006
Antwort Antwort
xthing

Registriert seit: 3. Jun 2006
69 Beiträge
 
#1

Unit ohne Formular

  Alt 28. Jun 2006, 17:42
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
  Mit Zitat antworten Zitat
EDatabaseError

Registriert seit: 11. Mai 2005
Ort: Göppingen
1.238 Beiträge
 
Delphi 2007 Professional
 
#2

Re: Unit ohne Formular

  Alt 28. Jun 2006, 17:45
Du musst im Projectfile die Unit mit Formular löschen und nur über uses (in der unit mit dem Aufruf)einfügen.
Tobias
It's not a bug, it's a feature.
  Mit Zitat antworten Zitat
xthing

Registriert seit: 3. Jun 2006
69 Beiträge
 
#3

Re: Unit ohne Formular

  Alt 29. Jun 2006, 07:07
@EDatabaseError

Hi,

danke , das habe ich gemacht. Funktioniert aber trotzdem nicht. Mein Projektfile sieht so aus:

Delphi-Quellcode:
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.
Was muss ich nun, wo ändern?

Danke noch mal.
xthing
  Mit Zitat antworten Zitat
Benutzerbild von Matze
Matze
(Co-Admin)

Registriert seit: 7. Jul 2003
Ort: Schwabenländle
14.929 Beiträge
 
Turbo Delphi für Win32
 
#4

Re: Unit ohne Formular

  Alt 29. Jun 2006, 07:12
Hi,

es müsste so in der Art ausschauen:

Delphi-Quellcode:
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.
'Unit3.pas' benötigst du im Projekt-Quelltext natürlich auch. Woher soll Delphi sonst wissen, was deine Unit 3 ist?

Doch eigentlich macht Delphi das automatisch.
  Mit Zitat antworten Zitat
Angel4585

Registriert seit: 4. Okt 2005
Ort: i.d.N.v. Freiburg im Breisgau
2.199 Beiträge
 
Delphi 2010 Professional
 
#5

Re: Unit ohne Formular

  Alt 29. Jun 2006, 07:13
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?
Martin Weber
Ich bin ein Rüsselmops
  Mit Zitat antworten Zitat
xthing

Registriert seit: 3. Jun 2006
69 Beiträge
 
#6

Re: Unit ohne Formular

  Alt 30. Jun 2006, 09:36
Danke, Ihr habt mir geholfen...

Xthing
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#7

Re: Unit ohne Formular

  Alt 30. Jun 2006, 09:46
@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:{$R *.dfm} . Dies kommt vor allem vor, wenn die Form nachträglich aus der Unit rausgelöscht wurde - wie schon vermutet.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:36 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz