Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Die Delphi-IDE (https://www.delphipraxis.net/62-die-delphi-ide/)
-   -   WinCRT32 Fehler?! (https://www.delphipraxis.net/78734-wincrt32-fehler.html)

plautzer 10. Okt 2006 14:50


WinCRT32 Fehler?!
 
Hallo zusammen,

im Rahmen des Delphiunterrichts hat uns unser PRof bestimmte uses variablen gegeben:

"Win32Crt, SysUtils, Math, UIOTool, UStrTool, UMixTool;"

mit denen wir arbeiten... er hat uns auch die dazugehörigen units zu verfügung mit Installationsantleitung gestellt.
Ich habe auch alles so durchgeführt, jedoch kommt mir beim compilen immer ein Fehler:

"[Fatal Error] Kreisumfang.dpr(5): F2063 Could not compile used unit 'Win32Crt.pas'"

Ich habe die Win32CRT.dcu in \lib ordner geschoben, geändert hat sich dadurch leider nichts!

Der Prof kann mir nicht weiter helfen... ich hoffe ihr habt Rat für mich, sonst siehts schlecht aus mitm lernen;)

Danke

Plautzer

Balu der Bär 10. Okt 2006 14:54

Re: WinCRT32 Fehler?!
 
Hallo,

programmierst du mit Delphi oder unter TurboPascal?

Die Unit Crt gibt es doch imho nur für TurboPascal. :gruebel:

Klaus01 10. Okt 2006 14:56

Re: WinCRT32 Fehler?!
 
Die Win32Crt ist definitiv für Delphi
und wird in der Regel benutzt wenn eine Consolenapplication
entwickelt wird. Zu finden ist die Unit hier -> http://mars.edu.wsnhid.pl/~s8608/Programowanie/?C=D;O=A

Grüße
Klaus

plautzer 10. Okt 2006 15:17

Re: WinCRT32 Fehler?!
 
Danke... es hat funktioniert.. jedoch sind jetzt wieder neue Fehlermeldungen hinzugekommen.

Wie machen vorwiegend pascal... da ich aber selber mit delphi arbeite, habe ich delphi 2005 drauf.

Gibt es da generell etwas zu beachten?


Hier ist die Win32Crt die der Prof nutzt... ich habe das mal mit dem alten inhalt, der win32crt.pas ersetzt:

Delphi-Quellcode:
{              A Special version of WinCrt, for use in Win32 only.
                       Copyright 1996-2001 ZieglerSoft

[url]WWW.ZieglerSoft.DK[/url]
[email]ZieglerSoft@ZieglerSoft.DK[/email]

}

Unit Win32Crt;

Interface

Uses SysUtils,Windows,Messages;

Var
  ScreenBuffer : PChar;
  WindowOrg   : TPoint = (X: cw_UseDefault; Y: cw_UseDefault);
  WindowSize  : TPoint = (X: cw_UseDefault; Y: cw_UseDefault);
  ScreenSize  : TPoint = (X: 80; Y: 25);
  Cursor      : TPoint = (X: 0; Y: 0);
  Origin      : TPoint = (X: 0; Y: 0);
  AutoTracking : Boolean = True;
  CheckEOF    : Boolean = False;
  CheckBreak  : Boolean = True;
  ShowScroll  : Boolean = True;
  ScrollScreen : Boolean = True;
  UseScrollKeys: Boolean = True;
  CanResize   : Boolean = True;
  CrtWindow   : HWnd = 0;
  WindowTitle : Array[0..79] of Char;
  InAktivTitle : Array[0..79] of Char;
  InactiveTitle: PChar='Inactive program: "%s" ';

Type
  Keyset = Set of Char; {Used to tell what keys we would allow in input
                         This is used by SmartInput / ScreenInput}
Var
  AllKeys  : KeySet = [#000..#255]; {Allow all keys in input
                                      used by SmartInput / ScreenInput}
Type
  InputJobs = Record   {Used by ScreenInput in an array where we have
                         one of theese records for each line we want to
                         input}
    X : Integer;       {Where must the input-string start?}
    Y : Integer;
    X1: Integer;       {Where must the 'Prompt' start?}
    Y1: Integer;
    L : Integer;       {Length of string we want to edit}
    S : AnsiString;    {The string we want to edit}
    P : AnsiString;    {The 'prompt'}
    AK: keySet;        {Accepted keys in this input. If not set,
                         then all keys can be used}
  End;


Procedure InitWinCrt;
Procedure DoneWinCrt;

Procedure WriteBuf(Buffer: PChar; Count: Word);
Procedure WriteChar(Ch: Char);

Function KeyPressed: Boolean;
Function ReadKey: Char;
Function ReadBuf(Buffer: PChar; Count: Word): Word;

Procedure GotoXY(X, Y: Integer);
Function WhereX: Integer;
Function WhereY: Integer;
Procedure ClrScr;
Procedure ClrEol;
 

Procedure CursorTo(X, Y: Integer);
Procedure ScrollTo(X, Y: Integer);
Procedure TrackCursor;

Procedure AssignCrt(var F: Text);

Procedure Delay(Msec:Word);
  {A delay-function that waits for at least Msec milliseconds}

Procedure TextOutPos(X,Y:Integer;What:String);
  {prints a string on the screen, at position X,Y, without moving the cursorpoint}

Procedure FillScreenChar(X,Y:Integer;Length:Integer;C:Char);
  {Prints a string of C chars, Length length at position X,Y}

Function SmartInput(X,Y:Integer;            {Where do we start}
                    Len:Integer;            {How long}
                    Var Value:AnsiString;   {In- and output}
                    OkKeys : KeySet;        {What keys are allowed}
                    TabAdvance:Boolean;     {True=tab returns up/down}
                    AutoAdvance:Boolean     {True=returns down when len}
                    ):Integer;              {0=Enter,-1=esc else key}
  {This function reads a string from the keyboard, but will return
   the key used to exit the procedure, as in a normal ReadKey where
   this is the second char returned (the first was #0) i.e. this is
   the extended char i.e. for PgUp, PgDn, Up and down.
   If TabAdvance is true, then a tab-char will return the same char
   as Down, and Shift+Tab will return the same code as Up.
   If Autoadvance is true, then if the char just entered was the last
   that could fit into the string, then the function returns the same
   code as Down}

Function ScreenInput(Var TheJob:Array of InputJobs):boolean;
  {A function, that can be used to input a complete screen-full of
   information in one go. You make an array of InputJobs, that is
   filled with the wanted information, then calls this function to
   get the data read from the screen.
   If False, then user exited by pressing ESC, else ENTER}



Implementation
Jedoch ist er nicht wirklich damit zufrieden:

Delphi-Quellcode:
[Warning] Win32Crt.pas(13): W1005 Unit 'Borland.Vcl.Windows' is specific to a platform
[Warning] Win32Crt.pas(13): W1005 Unit 'Borland.Vcl.Messages' is specific to a platform
[Error] Win32Crt.pas(16): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON}
[Warning] Win32Crt.pas(17): W1012 Constant expression violates subrange bounds
[Warning] Win32Crt.pas(17): W1012 Constant expression violates subrange bounds
[Warning] Win32Crt.pas(18): W1012 Constant expression violates subrange bounds
[Warning] Win32Crt.pas(18): W1012 Constant expression violates subrange bounds
[Error] Win32Crt.pas(32): E2397 Unsafe pointer only allowed if compiling with {$UNSAFECODE ON}
[Error] Win32Crt.pas(32): E2010 Incompatible types: 'PWideChar' and 'string'
[Warning] Win32Crt.pas(35): W1050 WideChar reduced to byte char in set expressions
[Error] Win32Crt.pas(59): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure
[Error] Win32Crt.pas(64): E2410 Unsafe pointer variables, parameters or consts only allowed in unsafe procedure
[Error] Win32Crt.pas(97): E2029 Declaration expected but end of file found
[Error] Win32Crt.pas(56): E2065 Unsatisfied forward or external declaration: 'InitWinCrt'
[Error] Win32Crt.pas(57): E2065 Unsatisfied forward or external declaration: 'DoneWinCrt'
[Error] Win32Crt.pas(59): E2065 Unsatisfied forward or external declaration: 'WriteBuf'
[Error] Win32Crt.pas(60): E2065 Unsatisfied forward or external declaration: 'WriteChar'
[Error] Win32Crt.pas(62): E2065 Unsatisfied forward or external declaration: 'KeyPressed'
[Error] Win32Crt.pas(63): E2065 Unsatisfied forward or external declaration: 'ReadKey'
[Error] Win32Crt.pas(64): E2065 Unsatisfied forward or external declaration: 'ReadBuf'
[Error] Win32Crt.pas(66): E2065 Unsatisfied forward or external declaration: 'GotoXY'
[Error] Win32Crt.pas(67): E2065 Unsatisfied forward or external declaration: 'WhereX'
[Error] Win32Crt.pas(68): E2065 Unsatisfied forward or external declaration: 'WhereY'
[Error] Win32Crt.pas(69): E2065 Unsatisfied forward or external declaration: 'ClrScr'
[Error] Win32Crt.pas(70): E2065 Unsatisfied forward or external declaration: 'ClrEol'
[Error] Win32Crt.pas(73): E2065 Unsatisfied forward or external declaration: 'CursorTo'
[Error] Win32Crt.pas(74): E2065 Unsatisfied forward or external declaration: 'ScrollTo'
[Error] Win32Crt.pas(75): E2065 Unsatisfied forward or external declaration: 'TrackCursor'
[Error] Win32Crt.pas(77): E2065 Unsatisfied forward or external declaration: 'AssignCrt'
[Error] Win32Crt.pas(79): E2065 Unsatisfied forward or external declaration: 'Delay'
[Error] Win32Crt.pas(82): E2065 Unsatisfied forward or external declaration: 'TextOutPos'
[Error] Win32Crt.pas(85): E2065 Unsatisfied forward or external declaration: 'FillScreenChar'
[Error] Win32Crt.pas(94): E2065 Unsatisfied forward or external declaration: 'SmartInput'
[Fatal Error] Template.dpr(12): F2063 Could not compile used unit 'Win32Crt.pas'

Klaus01 10. Okt 2006 15:30

Re: WinCRT32 Fehler?!
 
Sagen mir nicht wirklich viel, diese Fehlermeldungen.

Aber wenn Du Pascalprogramme in Delphi 2005 schreibst, mußt Du diese Programme
als Console Applikation erstellen.

Im Projekt sollte dann das stehen:

Delphi-Quellcode:
program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils,Win32Crt;

begin
  { TODO -oUser -cConsole Main : Insert code here }
end.
Grüße
Klaus

plautzer 11. Okt 2006 15:49

Re: WinCRT32 Fehler?!
 
Ich habe schon ein geschriebenes Programm, dass ich öffenen und ausführen möchte... ich nehme an, das es automatishc in der Konsole gestartet wird.

Der Prof hat uns ein WIN32CRT.dcu gegeben die wir einfügen sollen... kann ich diese irgendwie in die win32crt.pas umwandeln?

DevilsCamp 11. Okt 2006 15:55

Re: WinCRT32 Fehler?!
 
Zitat:

Zitat von plautzer
IDer Prof hat uns ein WIN32CRT.dcu gegeben die wir einfügen sollen... kann ich diese irgendwie in die win32crt.pas umwandeln?

Mir ist keine Möglichkeit bekannt.
Hast du schon versucht die Datei in dein Projektverzeichnis zu kopieren?

Klaus01 11. Okt 2006 16:09

Re: WinCRT32 Fehler?!
 
Zitat:

Zitat von plautzer
Ich habe schon ein geschriebenes Programm, dass ich öffenen und ausführen möchte... ich nehme an, das es automatishc in der Konsole gestartet wird.

Der Prof hat uns ein WIN32CRT.dcu gegeben die wir einfügen sollen... kann ich diese irgendwie in die win32crt.pas umwandeln?

Die dcu kannst Du nicht in eine pas Datei umwandeln.

Die dcu, welche Du bekommen hast, für welche Delphi Version ist die denn?

Wenn Ihr in der Schule eine andere Delphiversion nutzt als Du zuhause, wird unter Umständen
die dcu nicht geladen werden.

Grüße
Klaus

OldGrumpy 11. Okt 2006 16:19

Re: WinCRT32 Fehler?!
 
Öhm, Dein Quote der PAS-Datei endet mit der Zeile
Delphi-Quellcode:
Implementation
... Ist das wirklich das Ende des Files? Dann wundert mich die Fehlermeldung
Zitat:

[Error] Win32Crt.pas(97): E2029 Declaration expected but end of file found
überhaupt nicht. Desweiteren gibts einige "Unschönheiten" in dem File, lohnt sich vielleicht, das mal hübsch zu machen damit es nicht immer die nervigen Warnings und Hints gibt :)

plautzer 11. Okt 2006 17:10

Re: WinCRT32 Fehler?!
 
[quote="OldGrumpy"] Ist das wirklich das Ende des Files?/quote]

Ich hatte erst gedacht, das es die komplette datei sei, jedoch handelt es sich lediglich um eine halbertige dokumentation!

Ich arbeite mit Delphi 2005 pro und die programme, die ich abspielen möchte sind mit turbodelphi geschrieben. Die enthalten vom lehrer speziefische tools.


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:50 Uhr.
Seite 1 von 3  1 23      

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 by Thomas Breitkreuz