Autor Beitrag
JonasCleve
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 11.02.05 17:03 
Hi bin neu hier und hab eine Frage:
Ich wollte eine DLL für BlitzBasic Programmieren, da man mit Delphi/TP auf manche Resourcen einen Besseren Zugriff hat.
Jetzt hab ich was zum einstieg gemacht:
ausblenden volle Höhe Delphi-Quelltext
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:
LIBRARY DLL;

{ 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;

{$R *.res}

FUNCTION PLUS(a,b : INTEGER) : INTEGER;
BEGIN                           ;
        PlUS := a + b           ;
END                             ;

FUNCTION MINUS(a,b : INTEGER) : INTEGER;
BEGIN                           ;
        MINUS := a - b          ;
END                             ;

FUNCTION MAL(a,b : INTEGER) : INTEGER;
BEGIN                           ;
        MAL := a * b            ;
END                             ;

FUNCTION GETEILT(a,b : INTEGER) : REAL;
BEGIN                           ;
        GETEILT := a / b        ;
END                             ;


EXPORTS
        PLUS    ,
        MINUS   ,
        MAL     ,
        GETEILT ;

BEGIN
END.

Ist dieser Code richtig????
Wenn ich die DLL "baue" und in BlitzBasic einbinde bekomme ich eine Fehlermeldung!!
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 11.02.05 17:06 
wie lautet deine fehlermeldung denn ?
JonasCleve
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 11.02.05 17:10 
HI retnyg!!
Das Problem besteht nicht mehr!!!
Hab gerade ausm BlitzFoum ne Antwort bekommen!!!
Das Problem war, das ich hinter den Funktionen das stdcall; vergessen hatte!! :D :D
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 11.02.05 17:16 
freut mich ;)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 11.02.05 17:54 
Nur mal so nebenbei: Dein Quellcode ist unter aller Sau formatiert. ;)
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 11.02.05 18:17 
Luckie hat folgendes geschrieben:
Nur mal so nebenbei: Dein Quellcode ist unter aller Sau formatiert. ;)
Du siehst doch, daß er aus der Blitzbasic-Ecke kommt... :mrgreen:

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
JonasCleve
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 11.02.05 19:08 
Hmm und wie ist er vernünftig Formatiert??? :?:
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 11.02.05 19:10 
z.b. so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
FUNCTION PLUS(a,b : INTEGER) : INTEGER; stdcall;
BEGIN
  result := a + b;
END;
JonasCleve
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 12.02.05 10:27 
sry aber was ist der unterschied?????
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 12.02.05 10:41 
Die Strichpunkte stehen nicht alle an der selben Position,
die Beistriche im export-Teil auch nicht,
außerdem rückst du viel zu weit ein.

Ich empfehle dir das hier.

AXMD