AGB  ·  Datenschutz  ·  Impressum  







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

WinCRT32 Fehler?!

Ein Thema von plautzer · begonnen am 10. Okt 2006 · letzter Beitrag vom 22. Jan 2009
Antwort Antwort
Seite 1 von 3  1 23      
plautzer

Registriert seit: 23. Aug 2003
172 Beiträge
 
#1

WinCRT32 Fehler?!

  Alt 10. Okt 2006, 13:50
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
  Mit Zitat antworten Zitat
Balu der Bär
(Gast)

n/a Beiträge
 
#2

Re: WinCRT32 Fehler?!

  Alt 10. Okt 2006, 13:54
Hallo,

programmierst du mit Delphi oder unter TurboPascal?

Die Unit Crt gibt es doch imho nur für TurboPascal.
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.756 Beiträge
 
Delphi 10.4 Sydney
 
#3

Re: WinCRT32 Fehler?!

  Alt 10. Okt 2006, 13:56
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
Klaus
  Mit Zitat antworten Zitat
plautzer

Registriert seit: 23. Aug 2003
172 Beiträge
 
#4

Re: WinCRT32 Fehler?!

  Alt 10. Okt 2006, 14:17
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.Windowsis specific to a platform
[Warning] Win32Crt.pas(13): W1005 Unit 'Borland.Vcl.Messagesis 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: 'PWideCharand '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'
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.756 Beiträge
 
Delphi 10.4 Sydney
 
#5

Re: WinCRT32 Fehler?!

  Alt 10. Okt 2006, 14:30
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
Klaus
  Mit Zitat antworten Zitat
plautzer

Registriert seit: 23. Aug 2003
172 Beiträge
 
#6

Re: WinCRT32 Fehler?!

  Alt 11. Okt 2006, 14:49
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?
  Mit Zitat antworten Zitat
DevilsCamp
(Gast)

n/a Beiträge
 
#7

Re: WinCRT32 Fehler?!

  Alt 11. Okt 2006, 14:55
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?
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.756 Beiträge
 
Delphi 10.4 Sydney
 
#8

Re: WinCRT32 Fehler?!

  Alt 11. Okt 2006, 15:09
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
Klaus
  Mit Zitat antworten Zitat
Benutzerbild von OldGrumpy
OldGrumpy

Registriert seit: 28. Sep 2006
Ort: Sandhausen
941 Beiträge
 
Delphi 2006 Professional
 
#9

Re: WinCRT32 Fehler?!

  Alt 11. Okt 2006, 15:19
Öhm, Dein Quote der PAS-Datei endet mit der Zeile 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
"Tja ja, das Ausrufezeichen... Der virtuelle Spoiler des 21. Jahrhunderts, der Breitreifen für die Datenautobahn, die k3wle Sonnenbrille fürs Usenet. " (Henning Richter)
  Mit Zitat antworten Zitat
plautzer

Registriert seit: 23. Aug 2003
172 Beiträge
 
#10

Re: WinCRT32 Fehler?!

  Alt 11. Okt 2006, 16:10
[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.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 3  1 23      


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 01:24 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