Thema: Delphi DLLs

Einzelnen Beitrag anzeigen

ByStones2

Registriert seit: 6. Okt 2005
Ort: Birenbach
133 Beiträge
 
Turbo Delphi für Win32
 
#14

Re: DLLs

  Alt 7. Jun 2006, 11:57
Zitat:
Der Prozendureinsprung 'tset' wurde in der 'rechen.DLL' nicht gefunden.
Tja geht nicht

Wenn ich schowmessage bei uses in der DLL reinschreibe:
Zitat:
[Fatal Error] rechnen.dpr(16): F1026 File not found: 'ShowMessage.dcu'
Zitat von Luckie:
Die Unit, in der die Funktion ShowMessasge deklariert ist, heißt dialogs.pas.
Wie muss das aussehen:
DLL:
Delphi-Quellcode:
library rechnen;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }


uses
  SysUtils, Classes, Messages, dialogs;

{$R *.res}


function addiere(zahl1, zahl2: integer): integer; stdcall;
begin
  result := zahl1+zahl2;
end;

procedure test; stdcall;
begin
showmessage('hi!');
end;

exports
  addiere,
  test;

begin

end.
dann kommt der Error:
[Fatal Error] F2039 Could not create output file 'rechnen.dll'
Wer nämlich mit "h" schreibt ist dämlich.
  Mit Zitat antworten Zitat