Salut
J ai un afficheur lcd alphanumerique branché sur une carte pci avec un port paralelle .
Je cherche à ecrire dessus .
J ai trouvé ce composanr delphi ; TArtLcd
La demo de ce composant fonctionne .
Puis je l utiliser avec bcb6 ?
Version imprimable
Salut
J ai un afficheur lcd alphanumerique branché sur une carte pci avec un port paralelle .
Je cherche à ecrire dessus .
J ai trouvé ce composanr delphi ; TArtLcd
La demo de ce composant fonctionne .
Puis je l utiliser avec bcb6 ?
Si tu as un fichier dpk ou cpk ?? (je connais pas l'extension des packages C++Builder), alors probablement
si c'est un DPROJ ou CBPROJ ou même BDSProj, c'est conçu pour du 2005 ou plus, le code risque de pas compiler
un dpk qui s installe sur delphi 7 , pour bcb , c est bpk
mais sous bcb6 , rien n est ajouté à la palette
je fais comme ceci
composant
ajouter un composant
dans un nouveau paquet
nom d unité je choisis mon .pas
nom de paquet , je rentre artlcd
compiler
installer
lorsque je verifie
composant
installer des paquets
je vois artlcd mais la liste de composants reste vide
Le composant est installé , je devrais faire plus attention sur les noms que je donne à mes paquets :oops: .
A la compilation avec simplement ce composant non visuel j ai deux erreurs :
void __fastcall SetCustomChar(const Byte char, const char * bitmap);
[C++ Error] artlcd.hpp(144): E2176 Trop de types dans la déclaration
Fonction non essentielle donc je zappe pour le moment , elle sert à ecrire pixel par pixel dans un bloc reservé à l affichage d un caractere .
__published:
[C++ Error] artlcd.hpp(156): E2321 La déclaration ne spécifie pas un repère ou un identificateur
Aide Borland : Cette déclaration ne déclare rien. Ceci peut indiquer un struct ou un union sans repère ou sans variable dans la déclaration. C++ exige que quelque chose soit déclaré.
Par exemple :
Code:
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187 // Borland C++ Builder // Copyright (c) 1995, 2002 by Borland Software Corporation // All rights reserved // (DO NOT EDIT: machine generated header) 'artlcd.pas' rev: 6.00 #ifndef artlcdHPP #define artlcdHPP #pragma delphiheader begin #pragma option push -w- #pragma option push -Vx #include <Windows.hpp> // Pascal unit #include <Classes.hpp> // Pascal unit #include <SysUtils.hpp> // Pascal unit #include <SysInit.hpp> // Pascal unit #include <System.hpp> // Pascal unit //-- user supplied ----------------------------------------------------------- namespace Artlcd { //-- type declarations ------------------------------------------------------- class DELPHICLASS EArtLCDException; class PASCALIMPLEMENTATION EArtLCDException : public Sysutils::Exception { typedef Sysutils::Exception inherited; public: #pragma option push -w-inl /* Exception.Create */ inline __fastcall EArtLCDException(const AnsiString Msg) : Sysutils::Exception(Msg) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateFmt */ inline __fastcall EArtLCDException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateRes */ inline __fastcall EArtLCDException(int Ident)/* overload */ : Sysutils::Exception(Ident) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateResFmt */ inline __fastcall EArtLCDException(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateHelp */ inline __fastcall EArtLCDException(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateFmtHelp */ inline __fastcall EArtLCDException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateResHelp */ inline __fastcall EArtLCDException(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { } #pragma option pop #pragma option push -w-inl /* Exception.CreateResFmtHelp */ inline __fastcall EArtLCDException(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { } #pragma option pop public: #pragma option push -w-inl /* TObject.Destroy */ inline __fastcall virtual ~EArtLCDException(void) { } #pragma option pop }; typedef char TCharBitmap[8]; typedef char TCustomChars[8]; typedef void __stdcall (*pDISPLAYDLL_Init)(const Byte x_size, const Byte y_size, const char * startparam, PBOOL ok); typedef char * __stdcall (*pDISPLAYDLL_DriverName)(void); typedef char * __stdcall (*pDISPLAYDLL_Usage)(void); typedef char * __stdcall (*pDISPLAYDLL_DefaultParameters)(void); typedef void __stdcall (*pDISPLAYDLL_Done)(void); typedef void __stdcall (*pDISPLAYDLL_SetBacklight)(const bool on); typedef void __stdcall (*pDISPLAYDLL_SetContrast)(const Byte val); typedef void __stdcall (*pDISPLAYDLL_SetBrightness)(const Byte val); typedef void __stdcall (*pDISPLAYDLL_Write)(const char * str); typedef void __stdcall (*pDISPLAYDLL_SetPosition)(const Byte x, const Byte y); typedef void __stdcall (*pDISPLAYDLL_CustomChar)(const Byte ascii, const char * bitmap); typedef Word __stdcall (*pDISPLAYDLL_ReadKey)(void); typedef void __stdcall (*pDISPLAYDLL_SetGPO)(Byte GPO, bool GPOOn); typedef void __stdcall (*pDISPLAYDLL_SetFan)(Byte T1, Byte T2); typedef Byte __stdcall (*pDISPLAYDLL_CustomCharIndex)(Byte Index); class DELPHICLASS TArtLCD; class PASCALIMPLEMENTATION TArtLCD : public Classes::TComponent { typedef Classes::TComponent inherited; private: pDISPLAYDLL_Init pInit; pDISPLAYDLL_DriverName pDriverName; pDISPLAYDLL_Usage pUsage; pDISPLAYDLL_DefaultParameters pDefaultParameters; pDISPLAYDLL_Done pDone; pDISPLAYDLL_SetBacklight pSetBacklight; pDISPLAYDLL_SetContrast pSetContrast; pDISPLAYDLL_SetBrightness pSetBrightness; pDISPLAYDLL_Write pWrite; pDISPLAYDLL_SetPosition pSetPosition; pDISPLAYDLL_CustomChar pCustomChar; pDISPLAYDLL_ReadKey pReadKey; pDISPLAYDLL_SetGPO pSetGPO; pDISPLAYDLL_SetFan pSetFan; pDISPLAYDLL_CustomCharIndex pCustomCharIndex; AnsiString fDllName; char fcustomchar[8]; AnsiString fDrivername; AnsiString fUsage; AnsiString fDefaultParameters; bool fBackLight; Byte fContrast; Byte fBrightness; int fposx; int fposy; int fsizex; int fsizey; unsigned fdllh; AnsiString fparam; bool finit; public: __fastcall virtual TArtLCD(Classes::TComponent* AOwner); void __fastcall SetDLL(AnsiString Dname); void __fastcall Done(void); void __fastcall SetBacklight(bool b); void __fastcall SetContrast(Byte b); void __fastcall SetBrightness(Byte b); void __fastcall Write(AnsiString s); void __fastcall WriteXY(Byte x, Byte y, AnsiString s); void __fastcall SetPosition(int x, int y); void __fastcall SetCustomChar(const Byte char, const char * bitmap); char __fastcall ReadKey(void); void __fastcall SetGPO(Byte GPO, bool GPOOn); void __fastcall SetFan(Byte T1, Byte T2); void __fastcall SetPosX(int x); void __fastcall SetPosY(int y); bool __fastcall Init(void); __property AnsiString DriverName = {read=fDrivername}; __property AnsiString Usage = {read=fUsage}; __property AnsiString DefaultParameters = {read=fDefaultParameters}; ; __published: __property AnsiString DLLName = {read=fDllName, write=SetDLL}; __property int SizeX = {read=fsizex, write=fsizex, nodefault}; __property int SizeY = {read=fsizey, write=fsizey, nodefault}; __property AnsiString StartParam = {read=fparam, write=fparam}; __property int PosX = {read=fposx, write=SetPosX, default=0}; __property int PosY = {read=fposy, write=SetPosY, default=0}; __property Byte Contrast = {read=fContrast, write=SetContrast, default=128}; __property Byte Brightness = {read=fBrightness, write=SetBrightness, default=128}; __property bool BackLight = {read=fBackLight, write=SetBacklight, default=1}; public: #pragma option push -w-inl /* TComponent.Destroy */ inline __fastcall virtual ~TArtLCD(void) { } #pragma option pop }; //-- var, const, procedure --------------------------------------------------- extern PACKAGE void __fastcall Register(void); } /* namespace Artlcd */ using namespace Artlcd; #pragma option pop // -w- #pragma option pop // -Vx #pragma delphiheader end. //-- end unit ---------------------------------------------------------------- #endif // artlcd
Un point virgule de trop juste au dessus du fameux published
Je mets à dispo une source avec les dll et le composant qui vont bien .
Il reste juste à fixer la fonction SetCustomChar .