Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   USB Display - API Problem (Fehler bei Kompilierung) (https://www.delphipraxis.net/170131-usb-display-api-problem-fehler-bei-kompilierung.html)

delphihase 2. Sep 2012 16:24

Delphi-Version: XE

USB Display - API Problem (Fehler bei Kompilierung)
 
Hi,

habe mir jetzt mal ein ABACOM USB-LCD-Display für 4x20 Zeichen ASCII zugelegt. Funktioniert mit dem Demoprogramm einwandfrei, nur klappt das mit nem eigenen Projekt nicht so wie ich will.

Vorab: Die API gibts unter http://www.abacom-online.de/div/setup-usb-lcd.exe , die Anleitung dazu unter http://www.abacom-online.de/div/ABACOM_USB_LCD.pdf .

Das Sample Projekt für Delphi 5 funktioniert gut, ich kann es modifizieren und so das Display ansteuern. Nur das Problem ist, dass ich jetzt diese Unit in ein anderes Projekt einbauen will. Beim kompilieren kommt mir dann der Fehler:

ABACOM_USB_LCD_TLB.pas(497): E2064 Der linken Seite kann nichts zugewiesen werden

Die Zeile 497:
Delphi-Quellcode:
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);

Ich hoffe, es kann mir jemand helfen.

Danke im Voraus!

himitsu 2. Sep 2012 16:45

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Was ist FirstEventOfs? ( ein Property? )

Die Setup lad ich mir jetzt nicht runter ... wäre ja zu paraktisch, wenn es die PAS pur gäbe.

delphihase 3. Sep 2012 10:45

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Liste der Anhänge anzeigen (Anzahl: 1)
Ich dachte, 628 Zeilen Quellcode sind zu viel ...

Hmm, die CControlData ist ein Typ von TControlData2, definiert in OleCtrls ...

Die ganze Funktion:

Delphi-Quellcode:
procedure TUSBLCDX.InitControlData;
const
  CEventDispIDs: array [0..9] of DWORD = (
    $000000C9, $000000CA, $000000CB, $000000CC, $000000CD, $000000CE,
    $000000CF, $000000D0, $000000D1, $000000D2);
  CTFontIDs: array [0..0] of DWORD = (
    $FFFFFE00);
  CControlData: TControlData2 = (
    ClassID: '{32F7D76C-7571-4142-8C35-A78F5CCE120D}';
    EventIID: '{CCA105D4-0627-49C3-8181-D097ED4B5A30}';
    EventCount: 10;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: nil (*HR:$00000000*);
    Flags: $0000001D;
    Version: 401;
    FontCount: 1;
    FontIDs: @CTFontIDs);
begin
  ControlData := @CControlData;
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
end;
Im Anhang das Sample-Projekt für Delphi 5.

Mein Vorgehen für das neue Projekt:
VCL-Anwendung erstellt
ABACOM_USB_LCD_TLB.pas hinzugefügt und in die includes
die Includes des Sample Projects, welche bei mir nicht vorhanden waren, auch inkludiert

Soll ich sonst noch was uploaden?

hathor 3. Sep 2012 11:19

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Bei mir gibt es den Fehler: Klasse nicht registriert.

OCX fehlt - ActiveX ?

delphihase 3. Sep 2012 11:37

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Hat mich zwar auch gewundert, aber auch in der lauffähigen Version ist dieses @@ drin ...

Das Entfernen von einem @ ändert allerdings nichts an dem Fehler. :cry:

hathor 3. Sep 2012 11:48

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
So OCX ist geladen und registriert.

Sowohl Original-EXE als auch selbstcompilierte EXE sind fehlerfrei.

DELPHI 2009

delphihase 3. Sep 2012 12:11

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Sorry, aber was muss ich tun, um diese OCX zu registrieren?

Von OCX noch nie was gehört und Google sagt auch nur was von ActiveX, und damit habe ich noch nie gearbeitet.

hathor 3. Sep 2012 12:50

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Das macht das setup_usb_lcd.exe automatisch.
Vor dem 1. Test hatte ich das Setup noch nicht ausgeführt.

delphihase 3. Sep 2012 13:08

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Diese Setup-Datei habe ich ja installiert !?!

Also habe ich jetzt deinstalliert, nochmal installiert - gleicher Fehler ...

Welche Dateien hast du bei deinem neuen Projekt alle drin? (Kannst du das vielleicht als zip hochladen, evtl. kann er das ja kompilieren ...)

DeddyH 3. Sep 2012 13:24

AW: USB Display - API Problem (Fehler bei Kompilierung)
 
Musst Du die *.ocx evtl. noch in Delphi installieren (Komponente - Komponente importieren)?


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

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