AbetoDesign_FactuGES2/Database/udfs/funciones.pas

35 lines
669 B
ObjectPascal
Raw Normal View History

unit funciones;
interface
function RtfToText(Cadena: PChar): PChar; cdecl; export;
implementation
uses
Forms, Classes, SysUtils, StdCtrls, ComCtrls,
Menus, Windows;
function RtfToText(Cadena: PChar): PChar;
var
AStream : TStringStream;
ARichEdit: TRichEdit;
begin
ARichEdit := TRichEdit.CreateParented(HWND_MESSAGE);
try
AStream := TStringStream.Create(Cadena);
try
ARichEdit.SelectAll;
ARichEdit.SelText := StrPas(Cadena);
Result := PChar(ARichEdit.Text);
finally
FreeAndNIL(AStream);
end;
finally
FreeAndNIL(ARichEdit);
end;
end;
end.