Ich poste einfach mal ein Stück
Unit-Kopf von unserem
Quickreport-Preview.
Delphi-Quellcode:
TQRPreview = class(TAutoObject, IQRPreview, IQueryInfo, IExtractImage, IPersistFile)
private
protected
{IQueryInfo}
function GetInfoTip(dwFlags: DWORD; var ppwszTip: PWideChar): HResult; stdcall;
function GetInfoFlags(out pdwFlags: DWORD): HResult; stdcall;
{IPersistFile}
function IsDirty: HResult; stdcall;
function Load(pszFileName: POleStr; dwMode: Longint): HResult; stdcall;
function Save(pszFileName: POleStr; fRemember: BOOL): HResult; stdcall;
function SaveCompleted(pszFileName: POleStr): HResult; stdcall;
function GetCurFile(out pszFileName: POleStr): HResult; stdcall;
function GetClassID(out classID: TCLSID): HResult; stdcall;
{IExtractImage}
function GetLocation(Buffer: POleStr;
BufferSize: DWORD;
var Priority: DWORD;
var Size: Windows.TSize;
ColorDepth: DWORD;
var Flags: DWORD): HResult; stdcall;
function Extract(var BitmapHandle: HBITMAP): HResult; stdcall;
public
procedure Initialize; override;
destructor Destroy; override;
end;
Und das Ganze implementiert man in einem ComServer.