Autor Beitrag
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Sa 15.11.03 11:26 
Hallo,
ich möchte die RTfApi.dll in meiner Software verwenden damit ich RTF in HTML exportieren kann. Ich habe mir die Demo angeschaut (die auch funktioniert und gut kommentiert ist) und dann meine Unit in der die Funktion hinein sollte editiert. Ich möchte jedoch nicht mit den SaveDialog arbeiten sondern einen Pfad schon im vorherein festlegen. Bisher habe ich den folgenden Code der jedoch leider falsch ist:

ausblenden 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:
procedure TForm16.SaveFromRTF;
Var
 Filter : String;
 Converter : String;
 RTFStream : TStream;
  Begin
   RTFStream := TMemoryStream.Create;
   TRY
   Converter [];
   RichEdit1.PlainText := FALSE;
   RichEdit1.Lines.SaveToStream(RTFStream);
   If ExportFromRTF (ExtractFileDir(Application.ExeName)+'temp\rtf.tmp', Converter, RTFStream) Then
   Begin
    // OK.
   End ELSE
   Application.MessageBox (PChar('Die Datei konnte nicht gespeichert werden.'), 'Fehler',
                                     MB_ICONERROR+MB_OK);
   FINALLY
     RTFStream.Free;
   End;
  End;
 FINALLY
  ConverterList.Free;
 End;
end;


Ich habe auch alle anderen nötigen Dinge gemacht wie z.B. das Einbinden von RTFTools.pas.
Meine Fragen:
1. Was kommt zwischen die Kantenklammern bei "Converter [];". Compiler meldet das der Wert integer sein muss, ich denke mal das da reinkommt in welches Format exportiert werden soll. In der Demo wird dort ja mit den SaveDialog gearbeitet.
2. Ist der Rest des Codes richtig oder habe ich alles falsch gemacht?

Hoffe das mir jemand helfen kann, auf meine Support Mail wird nicht geantwortet.....

Greetz

PS: Hier gibts diese DLL, is free: www.toolhouse-westware.de
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 17.11.03 08:58 
onlinehome hat folgendes geschrieben:
1. Was kommt zwischen die Kantenklammern bei "Converter [];". Compiler meldet das der Wert integer sein muss, ich denke mal das da reinkommt in welches Format exportiert werden soll. In der Demo wird dort ja mit den SaveDialog gearbeitet.

Dann zeig mal die Zeile wie sie im Demo aussieht.

Gruß
Tino
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Mo 17.11.03 09:26 
Ich habe es einmal so gemacht:
ausblenden volle Höhe 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:
procedure HTML2BMP(var BMP  : TBitmap;
                       Name : string;
                       PixT : TPixelFormat;
                       Ext  : string;
                       num  : integer);
  var Filter, ExFilter : string;
      ConverterList,
      ExConverterList  : TStringList;
      Converter : string;
      RTFStream : TStream;
      IList     : TStringList;
      Index     : integer;
      doneOk    : boolean;
begin
  doneOk := false;
  try
    ConverterList   := TStringList.Create;
    ExConverterList := TStringList.Create;
    IList := TStringList.Create;
    RTFStream := TMemoryStream.Create;
    GetImportConverters(ConverterList);
    GetImportFilters(Filter);
    GetExportConverters(ExConverterList);
    GetExportFilters(ExFilter);
    Index := MakeFilterList(Filter, Ext, IList);
    //Dokument laden
    Converter := ConverterList[Index];
    if ImportAsRTF(Name, Converter, RTFStream) then begin
      IList.Clear;
      Index := MakeFilterList(ExFilter, '.HTM', IList);
      Converter := ExConverterList[Index];
      if ExportFromRTF(ExtractFilePath(Application.ExeName) +
                       'Convert\Convert.html',
                       Converter, RTFStream) then doneOk := true
    end
    else MessageDlg('Dokument konnte nicht gelesen werden',
                    mtWarning, [mbOk], 0);
  finally
    IList.Free;
    ConverterList.Free;
    ExConverterList.Free;
    RTFStream.Free
  end;
  if doneOk then
    ReadHTML(BMP, PixT,
             ExtractFilePath(Application.ExeName) +
             'Convert\Convert.html', num);
end;


Ich hoffe es hilft Dir weiter.

Sven

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 17.11.03 21:18 
Tino hat folgendes geschrieben:
onlinehome hat folgendes geschrieben:
1. Was kommt zwischen die Kantenklammern bei "Converter [];". Compiler meldet das der Wert integer sein muss, ich denke mal das da reinkommt in welches Format exportiert werden soll. In der Demo wird dort ja mit den SaveDialog gearbeitet.

Dann zeig mal die Zeile wie sie im Demo aussieht.

Gruß
Tino


Das ist alles, hätte ich nur die eine Zeile gepostet wäre es verwirrend geworden.
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:
procedure TForm1.SaveFromRTF;
Var
  Filter : String;
  ConverterList : TStringList;
  Converter : String;
  RTFStream : TStream;
begin
  ConverterList := TStringList.Create;
  TRY
   GetExportConverters (ConverterList);
   GetExportFilters (Filter);
   SaveDialog.Filter := Filter;
  {$IfDef GERMAN}
   SaveDialog.Title := 'Dokument exportieren ...';
  {$ELSE}
   SaveDialog.Title := 'Export document ...';
  {$EndIf}
 // ·····················
   If SaveDialog.Execute Then
   Begin
    RTFStream := TMemoryStream.Create;
    TRY
    Converter := ConverterList [SaveDialog.FilterIndex - 1];
    RichEdit1.PlainText := FALSE;
    RichEdit1.Lines.SaveToStream(RTFStream);
    If ExportFromRTF (SaveDialog.FileName, Converter, RTFStream) Then
    Begin
     // OK.
    End ELSE
  {$IfDef GERMAN}
    Application.MessageBox (PChar('Die Datei '+SaveDialog.FileName+
                                     ' konnte nicht gespeichert werden.'), 'Fehler',
                                      MB_ICONERROR+MB_OK);
  {$ELSE}
    Application.MessageBox (PChar('Error while saving '+SaveDialog.FileName+ '. '),
                                  'Error',
                                   MB_ICONERROR+MB_OK);
  {$EndIf}
    FINALLY
      RTFStream.Free;
    End;
   End; // If SaveDialog.Execute Then ...


Sorry Sven, aber ich kenn mich in deinen Code nicht wirklich aus. Kannste den für mich umbauen?
maze2k
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Mo 17.11.03 21:43 
Diese DLL is nich zufällig Freeware?

Ich suche nämlich zur Zeit ein Script, mit dem ich RTF in HTML und umgekehrt umwandeln kann (siehe aktueller Post von mir in diesem Forum).

Brauche das Skript aber auch zur kommerziellen Nutzung!

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Di 18.11.03 07:50 
Diese Funktion wird benötigt, da Du ohne Dialog die Datei speichern willst
ausblenden volle Höhe 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:
function MakeFilterList(Filter, Ext: string; var IList: TStringList): integer;
  var ende, i,
      num     : integer;
      aText   : string;
begin
  Result := 0;
  aText := '';
  num   := 1;
  while true do begin
    ende := Pos('|', Filter);
    if ende > 0 then begin
      aText := aText + Copy(Filter, 0, ende-1);
      if num = 1 then aText := aText + '|';
      Delete(Filter, 1, ende);
      if num = 2 then begin
        IList.Add(UpperCase(aText));
        aText := '';
        num := 1
      end
      else Inc(num)
    end
    else begin
      aText := aText + Filter;
      IList.Add(UpperCase(aText));
      break
    end;
  end;
  for i := 0 to IList.Count-1 do
    if Pos(Ext, IList.Strings[i]) > 0 then begin
      Result := i;
      break
    end;
end;


Jetzt der Code als Ergänzung zu deiner Funktion
ausblenden volle Höhe 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:
procedure TForm16.SaveFromRTF;
  Var Filter : String;
        Converter : String;
        RTFStream : TStream;
        ConverterList  : TStringList;
        IList     : TStringList;
        Index     : integer;
  begin
     RTFStream := TMemoryStream.Create;
     ConverterList   := TStringList.Create;
     IList := TStringList.Create; 
     TRY
       GetExportConverters(ConverterList);
       GetExportFilters(Filter);
       Index := MakeFilterList(Filter, '.HTM', IList);
       Converter := ConverterList[Index];
       RichEdit1.PlainText := FALSE;
       RichEdit1.Lines.SaveToStream(RTFStream);
       If ExportFromRTF (ExtractFileDir(Application.ExeName)+'temp\rtf.tmp', Converter, RTFStream) Then
          Begin
            // OK.
          End Else
            Application.MessageBox (PChar('Die Datei konnte nicht gespeichert werden.'), 'Fehler',
                                     MB_ICONERROR+MB_OK);
     FINALLY
       RTFStream.Free;
       ConverterList.Free;
        IList.Free;
     End;
  End;
end;


Probiers mal aus. Es müßte gehen.

Gruß Sven

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Di 18.11.03 08:04 
maze2k hat folgendes geschrieben:
Diese DLL is nich zufällig Freeware?

Ich suche nämlich zur Zeit ein Script, mit dem ich RTF in HTML und umgekehrt umwandeln kann (siehe aktueller Post von mir in diesem Forum).

Brauche das Skript aber auch zur kommerziellen Nutzung!


ausblenden volle Höhe 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:
(******************************************************************************
//                                                                           //
//  RTFapi 1.5.0.5 · RTF-Convert-Dll · Borland Delphi 3+                    //
//  Copyright(C) 2001 by TOOLHOUSE WESTWARE                                  //
//  Release: 24.02.2002                                                      //
//                                                                           //
//  email: tw@toolhouse-westware.de                                          //
//  web:   http://www.toolhouse-westware.de                                  //
//                                                                           //
*******************************************************************************
//  Free for non-commercial use.                                             //
******************************************************************************
//                                                                           //
//  Das Modul RTFapi.dll dient zum Import von Fremdformaten nach RTF sowie   //
//  zum Export von RTF in Fremdformate. RTFapi.dll kapselt den Aufruf der    //
//  auf dem System installierten Text-Konvertierungsprogramme.               //
//  Das Projekt RTFapiDemo.dpr enthält den kompletten Sourcecode             //
//  des Demoprogrammes.                                                      //
//                                                                           //
//  Die Verwendung erfolgt auf eigene Gefahr, jegliche Ansprüche für         //
//  Schäden oder Fehlfunktionen sind ausgeschlossen. Fehlerreports bitte     //
//  an obenstehende EMail-Adresse senden. Die Weitergabe ist erlaubt.        //
//                                                                           //
//  Das Modul RTFapi.dll darf in nicht-kommerzieller Freeware frei           //
//  verwendet werden. Kommerzielle Nutzung ist nur mit unserer               //
//  ausdrücklichen Zustimmung erlaubt.                                       //
//                                                                           //
*******************************************************************************
//                       //
//  RTFapi.dll is a freeware-dll for converting common Textformats           //
//  (DOC, HTML, XLS ...) to Richttext (RTF) and the other way around,        //
//  based on the installed Textconverters. You can save the converted        //
//  text as file or put it directly into TRichedit or TRxRichEdit.           //
//  The project RTFapiDemo.dpr includes the Demoapp-sourcecode.              //
//                                                                           //
//  NO WARRANTY !                                                            //
//                               //
//  Free for non-commercial use.                                             //
//  For questions, reports or commercial use please contact:                 //
//  tw@toolhouse-westware.de                                                 //
//                                                                           //
*******************************************************************************)

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 18.11.03 13:12 
Ok, danke werde mal den code ausprobieren.
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 18.11.03 21:08 
Hier kommtn Fehler:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm16.FormCreate(Sender: TObject);
begin
 RTFDllName := ExtractFilePath(ParamStr(0)) + RTFDllName;
end;


Compiler hat folgendes geschrieben:
Der linken Seite kann nichts zugewiesen werden
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Mi 19.11.03 07:47 
Dafür gibt es zwei Lösungen:
1. Du hakst unter Optionen/Compiler/Syntaxoptionen Zuweisbare typisierte
Konstanten
ab, oder
2. Du entfernst in der Datei RTFtools.pas diese Zeile
ausblenden Delphi-Quelltext
1:
  RTFDllName : String = 'RTFApi.DLL';					

dann mußt Du allerdings diese Zeile
ausblenden Delphi-Quelltext
1:
RTFDllName := ExtractFilePath(ParamStr(0)) + RTFDllName;					

folgendermaßen abändern
ausblenden Delphi-Quelltext
1:
RTFDllName := ExtractFilePath(ParamStr(0)) + 'RTFApi.DLL';					

Gruß Sven

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 19.11.03 10:55 
Habe jetzt alle Änderungen gemacht, gibt aber noch nen Fehler in der RTFTools.pas > www.softprose.any-ke...s_error_compiler.png
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Mi 19.11.03 12:35 
onlinehome hat folgendes geschrieben:
Habe jetzt alle Änderungen gemacht, gibt aber noch nen Fehler in der RTFTools.pas > www.softprose.any-ke...s_error_compiler.png


Sorry, ich hatte nicht darauf geachtet :oops: du mußt const dann auch noch auskommentieren.

Hätte Dir aber auch auffallen müssen :lol:

Gruß Sven

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: So 23.11.03 14:21 
Hi,
hier ist jetzt die ganze Unit, was ist falsch, was fehlt?

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:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
unit Unit16;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, Buttons, ToolWin, StdCtrls, JvColorCombo, JvCombobox;

type
  TForm16 = class(TForm)
    RichEdit1: TRichEdit;
    ToolBar2: TToolBar;
    Button1: TButton;
    Button2: TButton;
    ToolButton3: TToolButton;
    ToolBar1: TToolBar;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    ToolButton1: TToolButton;
    SpeedButton4: TSpeedButton;
    SpeedButton5: TSpeedButton;
    SpeedButton6: TSpeedButton;
    procedure Button2Click(Sender: TObject);
    procedure SpeedButton4Click(Sender: TObject);
    procedure SpeedButton5Click(Sender: TObject);
    procedure SpeedButton6Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure SaveFromRTF;
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form16: TForm16;

implementation

uses RTFTools, Unit2;

{$R *.dfm}

procedure TForm16.Button2Click(Sender: TObject);
begin
  close;
end;

procedure TForm16.SpeedButton4Click(Sender: TObject);
begin
  RichEdit1.Paragraph.Alignment :=taLeftJustify;
end;

procedure TForm16.SpeedButton5Click(Sender: TObject);
begin
  RichEdit1.Paragraph.Alignment :=tacenter;
end;

procedure TForm16.SpeedButton6Click(Sender: TObject);
begin
  RichEdit1.Paragraph.Alignment :=tarightJustify;
end;

procedure TForm16.SpeedButton1Click(Sender: TObject);
begin
  RichEdit1.SelAttributes.Style :=[fsBold];
end;

procedure TForm16.SpeedButton2Click(Sender: TObject);
begin
  RichEdit1.SelAttributes.Style :=[fsItalic];
end;

procedure TForm16.SpeedButton3Click(Sender: TObject);
begin
  RichEdit1.SelAttributes.Style :=[fsunderline];
end;

procedure TForm16.Button1Click(Sender: TObject);
begin
  SaveFromRTF;
end;

function MakeFilterList(Filter, Ext: string; var IList: TStringList): integer;
  var ende, i,
      num     : integer;
      aText   : string;
begin
  Result := 0;
  aText := '';
  num   := 1;
  while true do begin
    ende := Pos('|', Filter);
    if ende > 0 then begin
      aText := aText + Copy(Filter, 0, ende-1);
      if num = 1 then aText := aText + '|';
      Delete(Filter, 1, ende);
      if num = 2 then begin
        IList.Add(UpperCase(aText));
        aText := '';
        num := 1
      end
      else Inc(num)
    end
    else begin
      aText := aText + Filter;
      IList.Add(UpperCase(aText));
      break
    end;
  end;
  for i := 0 to IList.Count-1 do
    if Pos(Ext, IList.Strings[i]) > 0 then begin
      Result := i;
      break
    end;
end;

procedure TForm16.SaveFromRTF;
Var
        Filter : String;
        Converter : String;
        RTFStream : TStream;
        ConverterList  : TStringList;
        IList     : TStringList;
        Index     : integer;
   Begin
    RTFStream := TMemoryStream.Create;
    ConverterList   := TStringList.Create;
    IList := TStringList.Create; 
    TRY
    GetExportConverters(ConverterList);
    GetExportFilters(Filter);
    Index := MakeFilterList(Filter, '.HTM', IList);
    Converter := ConverterList[Index];
    RichEdit1.PlainText := FALSE;
    RichEdit1.Lines.SaveToStream(RTFStream);
    If ExportFromRTF (ExtractFileDir(Application.ExeName)+'temp\rtf.tmp', Converter, RTFStream) Then     
    Begin
     // OK.
    End ELSE
    Application.MessageBox (PChar('Die Datei konnte nicht gespeichert werden.'), 'Fehler',
                                      MB_ICONERROR+MB_OK);
    FINALLY
 RTFStream.Free;
       ConverterList.Free;
        IList.Free; 
  End;
end;

procedure TForm16.FormCreate(Sender: TObject);
begin
LoadLibrary('RTFApi.DLL');
end;

end.


Greetz
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Mo 24.11.03 07:41 
Wie lautet die Fehlermeldung?

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Mo 24.11.03 07:49 
Hier mal ein Auszug aus der Datei RTFtools.pas:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
unit RTFTools;
Interface
uses Windows, Forms, Classes, Sysutils, ShellApi;

Const
  RTFDllName : String = 'RTFApi.DLL';

...

Function InitRTFApi : Boolean;
var
  P : Function : Boolean; stdcall;
Begin
  TRY
    If RTFLib = 0 Then                             // Loading DLL
       RTFLib := LoadLibrary(PChar(RTFDllName));
    If RTFLib <> 0 Then                            
       P := GetProcAddress (RTFLib, 'InitMem');    // Initialize internal DLL memory
    Result := (RTFLib <> 0) AND P;
  EXCEPT
   Result := FALSE;
  End;
End;

Zuerst einmal würde ich die Funktion InitRTFApi in deinem Prog aufrufen.
Mache aus der bisherigen Konstante RTFDllName eine Variable und setze diese von deinem Programm aus.

Sven

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows