Autor Beitrag
Philipp_Reitter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 28.09.07 15:20 
hi

ich hab flgende dll geschreiben...

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:
48:
49:
50:
library Log;

uses
  SysUtils,
  Classes;

{$R *.res}

type
  TMsgType = (mtNormal, mtError, mtWarning);

  TLog        = class
    Filename  : pChar;
    Logfile   : TStringList;

    constructor Create(LogFileName : pChar; Header: pChar); stdcall;
    procedure Add(Msg: pChar; MsgType: TMsgType); stdcall;

end;

constructor TLog.Create(LogFileName : pChar; Header: pChar); stdcall;
begin
  inherited Create;

  Filename := LogFileName;
  LogFile  := TStringList.Create;
  
  Logfile.Add('<html> <body>');
  Logfile.Add('<h1>'+String(Header)+'</h1>');
  LogFile.Add('<table>');
end;

procedure TLog.Add(Msg: pChar; MsgType: TMsgType); stdcall;
var tmpMsg : String;
begin
  case MsgType of
    mtNormal   : tmpMsg := '';
    mtError    : tmpMsg := '<b><font color=''red''>Error</font></b>';
    mtWarning  : tmpMsg := '<b><font color=''yellow''>Warning</font></b>';
  end;

  LogFile.Add('<tr>');
  LogFile.Add('<td>'+tmpMsg+'</td>');
  LogFile.Add('<td>'+String(Msg)+'</td>');
  LogFile.Add('<tr>');
  LogFile.SaveToFile(String(Filename));
end;

begin
end.


nur wie kann ich dann in delphi die Class hernehmen die lässt er mich ned exportieren?!

Danke!
Mfg
Philipp
Critter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 328
Erhaltene Danke: 3

Windows 7
Delphi 7 Pro.
BeitragVerfasst: Fr 28.09.07 16:10 
Hallo,

ein ähnliches Problem hatte ich auch kürzlich. Hier habe ich ein paar Informationen bekommen, die dier vielleicht auch helfen können.

critter
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 28.09.07 16:13 
danke!

habs jetzt so gemaht dass die dll nur die procedure hatt und die unit die class...
und dann wird halt auf die dll zugegriffen...