![]() |
COM / DLL-Einbindung für Anfänger
Moin Gemeinde,
wieder eine der fürchterlichen Anfängerfragen: Ich möchte einige Funktionen aus einer externen Druck-DLL nutzen. Der Compiler stolpert aber über eine fehlerhafte Einbindung (forward-Deklaration): Wrapper (Auszug):
Delphi-Quellcode:
Und dann der Aufruf der externen Funktion aus der Delphi App:
const
IID_IDymoAddIn: TGUID = '{09DAFAE1-8EB0-11D2-8E5D-00A02415E90F}'; type IDymoAddIn = interface; IDymoAddIn = interface(IDispatch) ['{09DAFAE1-8EB0-11D2-8E5D-00A02415E90F}'] function Open(const FileName: WideString): WordBool; safecall; function Save: WordBool; safecall; function SaveAs(const FileName: WideString): WordBool; safecall; function Print(Copies: Integer; bShowDialog: WordBool): WordBool; safecall; procedure Hide; safecall; procedure Show; safecall; procedure SysTray(State: WordBool); safecall; procedure Quit; safecall; function Get_FileName: WideString; safecall; function SelectPrinter(const Printer: WideString): WordBool; safecall; function GetDymoPrinters: WideString; safecall; property FileName: WideString read Get_FileName; end;
Delphi-Quellcode:
Da gibts dann den Fehler "E2018 Record, Objekt oder Klassentyp erforderlich".
pfad := 'mylabel.lwl';
opened := DymoAddIn.Open(pfad); Wie macht man das noch richtig? ;-) Danke! |
AW: COM / DLL-Einbindung für Anfänger
Was ist DymoAddIn?
Und wenn ja, von wo kommt wie die Instanz her? |
AW: COM / DLL-Einbindung für Anfänger
Zitat:
Zitat:
Delphi-Quellcode:
Wenn da weitere Ausschnitte benötigt werden, schicke ich die gerne.
LIBID_Dymo: TGUID = '{DC8A996F-111D-42E2-BACF-EEC86F53B454}';
IID_IDymoAddIn: TGUID = '{09DAFAE1-8EB0-11D2-8E5D-00A02415E90F}'; |
AW: COM / DLL-Einbindung für Anfänger
E2018 is Delphi compiler error.
Please share a simple code showing how are you declaring DymoAddIn and its construction. |
AW: COM / DLL-Einbindung für Anfänger
Zitat:
Delphi-Quellcode:
const
LIBID_DymoSDK: TGUID = '{25D837F1-8D49-3354-A820-AE8ED312EC09}'; IID_IDymoLabel: TGUID = '{5748221F-3D1E-35AE-8F26-4D01C9798FE9}'; IID_IDymoPrinter: TGUID = '{2BED54B5-C7F6-3939-973A-AFB075AB9572}'; type // *********************************************************************// // Forward-Deklaration von in der Typbibliothek definierten Typen // *********************************************************************// IDymoLabel = interface; IDymoPrinter = interface; // *********************************************************************// // Interface: IDymoLabel // Flags: (4416) Dual OleAutomation Dispatchable // GUID: {5748221F-3D1E-35AE-8F26-4D01C9798FE9} // *********************************************************************// IDymoLabel = interface(IDispatch) ['{5748221F-3D1E-35AE-8F26-4D01C9798FE9}'] function Get_XMLContent: WideString; safecall; procedure Set_XMLContent(const pRetVal: WideString); safecall; function Get_Preview: PSafeArray; safecall; procedure Set_Preview(pRetVal: PSafeArray); safecall; function GetPreviewLabel: PSafeArray; safecall; procedure LoadLabelFromFilePath(const filePath: WideString); safecall; procedure LoadLabelFromXML(const XMLContent: WideString); safecall; function UpdateLabelObject(const labelObject: ILabelObject; const objectValue: WideString): WordBool; safecall; function SetImageFromFilePath(const objectName: WideString; const imageFile: WideString): WordBool; safecall; function SetImageFromBase64(const objectName: WideString; const base64String: WideString): WordBool; safecall; function Save(const fileName: WideString): WordBool; safecall; function GetLabelObject(const objName: WideString): ILabelObject; safecall; procedure GhostMethod_IDymoLabel_72_1; safecall; property XMLContent: WideString read Get_XMLContent write Set_XMLContent; property Preview: PSafeArray read Get_Preview write Set_Preview; end; HTH |
AW: COM / DLL-Einbindung für Anfänger
Delphi-Quellcode:
Var
MyDymoAddIn: IDymoAddIn; ... MyDymoAddIn := DymoAddIn; MyDymoAddIn.open(...); ... |
AW: COM / DLL-Einbindung für Anfänger
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:03 Uhr. |
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