Autor Beitrag
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Fr 05.05.06 16:59 
Also ich will eine selbst geschrieben DLL austesten, dazu hab ich sie jetzt einfach mal eingebunden, beim Starten der "Test" Anwendung bringt er aber folgende Fehlermeldung:
:7c816d4f kernel32.RegisterWaitForInputIdle + 0x49

Hier ist mal der Quellcode von der DLL:
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:
library Project1;

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  Dialogs,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}

procedure UpdateInfo(language: string); export; stdcall;
begin
  if (language = 'DE') OR (language='GER') then begin                 //dt. Paket
    unit2.Form2.Caption := 'Über den Updater...';
    unit2.Form2.image2.hint := 'Dieses Fenster schließen';
    unit2.Form2.Label2.Caption := 'Version 1.0 Beta';
    unit2.Form2.Label3.Caption := 'Veröfentlicht am: 01.06.2006';
    unit2.Form2.Label4.Caption := 'Geschrieben von Name';
    unit2.Form2.Label5.Caption := 'Bei Interesse melden sie sich bitte bei Mail';
  end else if (language = 'US') OR (language = 'GB') OR (language = 'USA') then begin //englisches Paket
    unit2.Form2.Caption := 'About Updater...';
    unit2.Form2.image2.hint := 'Close window';
    unit2.Form2.Label2.Caption := 'Version 1.0 Beta';
    unit2.Form2.Label3.Caption := 'Published on 01.06.2006';
    unit2.Form2.Label4.Caption := 'Written by name';
    unit2.Form2.Label5.Caption := 'Interessted? Mail to: mail';
  end else begin         //Paket nicht verfügbar
  messagedlg('Das Sprachpaket ' + language + ' ist nicht verfügbar! Error-Code: 00x01', mtwarning, [mbOK], 0);
  end;
  unit2.Form2.ShowModal;
end;

begin
end.

exports
  UpdateInfo name 'updateinfo';


Und hier der von der "Test" Anwendung:
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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure UpdateInfo(language: string); stdcall; external 'Test.dll';

procedure TForm1.Button1Click(Sender: TObject);
var i : string;
begin
  i := InputBox('Sprachpaket', 'Bitte geben sie ein zu ladendes Sprachpaket an.', 'DE');
  updateinfo(i);
end;

end.


Zuletzt bearbeitet von Hack Gott am Di 04.05.10 16:42, insgesamt 1-mal bearbeitet
Clemens L.
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 158

Win Xp SP3
D6 Enterprise, Turbo Delphi Explorer
BeitragVerfasst: Fr 05.05.06 17:53 
ausblenden Delphi-Quelltext
1:
procedure UpdateInfo(language: string); export; stdcall;					


Ich weiss nicht ob ich recht hab, aber versuch mal das "export;" wegzumachen, und unten in der DLL einfach nur
ausblenden Delphi-Quelltext
1:
2:
exports 
UpdateInfo;


einzugeben.



Wie gesagt... Ich weiss nicht ob das hilft, aber einen Versuch ist es Wert!

Außerdem greifst du in der DLL auf eine Unit2 zu, in der Test-Anwendung steht aber Unit1.
Es gibt auch keine Form2 in dem Code den du mir gezeigt hast, also liegt es vll. daran?
Hack Gott Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Fr 05.05.06 18:09 
user profile iconhackerTreff hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
procedure UpdateInfo(language: string); export; stdcall;					

Ich weiss nicht ob ich recht hab, aber versuch mal das "export;" wegzumachen, und unten in der DLL einfach nur
ausblenden Delphi-Quelltext
1:
2:
exports 
UpdateInfo;


einzugeben.
Klappt leider nicht.
user profile iconhackerTreff hat folgendes geschrieben:


Außerdem greifst du in der DLL auf eine Unit2 zu, in der Test-Anwendung steht aber Unit1.
Es gibt auch keine Form2 in dem Code den du mir gezeigt hast, also liegt es vll. daran?


in der DLL hab ich für ne andere Prozedur noch ne unit1 erstellt, da greif ich aber noch nicht drauf zu, und in der Test Anwendung gibt es nur eine unit1, weil ich die ja nur dazu brauche um einen Button drauf zu plazieren, auf den man klicken kann um die Prozedur in der DLL aufzurufen.
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Sa 06.05.06 12:02 
Erstell mal eine neue DLL und les dir den Text durch.

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Hack Gott Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: So 07.05.06 18:27 
user profile iconuall@ogc hat folgendes geschrieben:
Erstell mal eine neue DLL und les dir den Text durch.


Welchen Text?
The Who
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 25

Win XP Prof
D3 Prof, D8, D7E
BeitragVerfasst: So 07.05.06 18:39 
Man soll keine Strings in DLL übergeben, weil man sonst ne DLL von Borland braucht. Ich hoffe das mein uall@ogc. Benutz lieber Pchar.
Hack Gott Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: So 07.05.06 18:47 
user profile iconThe Who hat folgendes geschrieben:
Man soll keine Strings in DLL übergeben, weil man sonst ne DLL von Borland braucht. Ich hoffe das mein uall@ogc. Benutz lieber Pchar.


ok, mom..., klappt immer noch nicht!

selbe fehlermeldung wie vorher!