Bonjour à tous
Je'ai une application qui fonctionne sans soucis en CLX. Je suis en train de la passer en VCL. Et je suis confronté à une erreur à la compilation. (Delphi 7)
Dans une unité j'utilise la bibliothèque Comport. Tous les modules de cette bibliothèque sont dans un dossier Cport. Ce dossier est, bien entendu, déclaré dans le chemin des bibliothèques, puisque, comme je viens de l'écrire, en CLX tout fonctionne. Mais quand je compile en VCL, j'ai le message suivant pour le module CportTrmSet
et voilà le code[Erreur] CPortTrmSet.pas(101): Identificateur non déclaré : 'TranslateProperties'
J'ai mis cet ordre en commentaire, juste pour voir la suite. Je n'ai pas été déçu ! Le module CportSetup ne trouve pas la classe TComComboBox. Or cette classe est bien définie dans un module CPortCtl et voila le début de CportSetup
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95 unit CPortTrmSet; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CPortCtl; type TComTrmSetForm = class(TForm) GroupBox1: TGroupBox; CheckBox1: TCheckBox; CheckBox2: TCheckBox; CheckBox3: TCheckBox; CheckBox4: TCheckBox; CheckBox5: TCheckBox; GroupBox2: TGroupBox; Label1: TLabel; ComboBox1: TComboBox; Label3: TLabel; Label4: TLabel; ComboBox2: TComboBox; Label2: TLabel; ComboBox3: TComboBox; Label5: TLabel; Button1: TButton; Button2: TButton; Edit1: TEdit; Edit2: TEdit; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; procedure EditComTerminal(ComTerminal: TCustomComTerminal); implementation uses gnugettext; {$R *.DFM} // show terminal setup dialog procedure EditComTerminal(ComTerminal: TCustomComTerminal); begin with TComTrmSetForm.Create(nil) do begin CheckBox1.Checked := ComTerminal.LocalEcho; CheckBox2.Checked := ComTerminal.SendLF; CheckBox3.Checked := ComTerminal.WrapLines; CheckBox4.Checked := ComTerminal.Force7Bit; CheckBox5.Checked := ComTerminal.AppendLF; ComboBox1.ItemIndex := Integer(ComTerminal.Caret); ComboBox2.ItemIndex := Integer(ComTerminal.Emulation); Edit1.Text := IntToStr(ComTerminal.Columns); Edit2.Text := IntToStr(ComTerminal.Rows); ComboBox3.ItemIndex := Integer(ComTerminal.ArrowKeys); if ShowModal = mrOK then begin ComTerminal.LocalEcho := CheckBox1.Checked; ComTerminal.SendLF := CheckBox2.Checked; ComTerminal.WrapLines := CheckBox3.Checked; ComTerminal.Force7Bit := CheckBox4.Checked; ComTerminal.AppendLF := CheckBox5.Checked; ComTerminal.Caret := TTermCaret(ComboBox1.ItemIndex); ComTerminal.Emulation := TTermEmulation(ComboBox2.ItemIndex); try ComTerminal.Columns := StrToInt(Edit1.Text); except ComTerminal.Columns := 80; end; try ComTerminal.Rows := StrToInt(Edit2.Text); except ComTerminal.Rows := 24; end; ComTerminal.ArrowKeys := TArrowKeys(ComboBox3.ItemIndex); end; Free; end; end; procedure TComTrmSetForm.FormCreate(Sender: TObject); begin TP_Ignore (self,'ComboBox1'); TP_Ignore (self,'ComboBox2'); TP_Ignore (self,'ComboBox3'); TP_Ignore (self,'Edit1'); TP_Ignore (self,'Edit2'); TranslateProperties (self,'cport'); <<<<<< Plantage sur cet ordre end; end.
Ce que je ne m'explique pas est pourquoi en CLX je n'ai aucun pb et ces deux messages en VCL
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 unit CPortSetup; {$I CPort.inc} interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Buttons, CPort, CPortCtl;
Partager