Skip to content

Instantly share code, notes, and snippets.

@stijnsanders
Created January 22, 2015 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stijnsanders/527806f66ad3a1139d7d to your computer and use it in GitHub Desktop.
Save stijnsanders/527806f66ad3a1139d7d to your computer and use it in GitHub Desktop.
Delphi ActiveX/COM wrapper for FDFACX.DLL
unit FDFACXLib_TLB;
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// PASTLWTR : 1.2
// File generated on 1/22/2015 10:15:21 PM from Type Library described below.
// ************************************************************************ //
// Type Lib: D:\Data\2015\r\pdf\FDFACX.DLL (1)
// LIBID: {CB830883-2E18-11D1-B8CF-00A0C9259304}
// LCID: 0
// Helpfile:
// HelpString: FdfAcX 1.0 Type Library
// DepndLst:
// (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface
uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
FDFACXLibMajorVersion = 1;
FDFACXLibMinorVersion = 0;
LIBID_FDFACXLib: TGUID = '{CB830883-2E18-11D1-B8CF-00A0C9259304}';
IID_IFdfApp: TGUID = '{CB830890-2E18-11D1-B8CF-00A0C9259304}';
CLASS_FdfApp: TGUID = '{CB830891-2E18-11D1-B8CF-00A0C9259304}';
IID_IFdfDoc: TGUID = '{CB830892-2E18-11D1-B8CF-00A0C9259304}';
CLASS_FdfDoc: TGUID = '{CB830893-2E18-11D1-B8CF-00A0C9259304}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
IFdfApp = interface;
IFdfAppDisp = dispinterface;
IFdfDoc = interface;
IFdfDocDisp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
FdfApp = IFdfApp;
FdfDoc = IFdfDoc;
// *********************************************************************//
// Interface: IFdfApp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {CB830890-2E18-11D1-B8CF-00A0C9259304}
// *********************************************************************//
IFdfApp = interface(IDispatch)
['{CB830890-2E18-11D1-B8CF-00A0C9259304}']
function FDFGetVersion: WideString; safecall;
function FDFCreate: IDispatch; safecall;
function FDFOpenFromFile(const bstrFileName: WideString): IDispatch; safecall;
function FDFOpenFromBuf(varFdfData: OleVariant): IDispatch; safecall;
function FDFOpenFromStr(const bstrFdfData: WideString): IDispatch; safecall;
end;
// *********************************************************************//
// DispIntf: IFdfAppDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {CB830890-2E18-11D1-B8CF-00A0C9259304}
// *********************************************************************//
IFdfAppDisp = dispinterface
['{CB830890-2E18-11D1-B8CF-00A0C9259304}']
function FDFGetVersion: WideString; dispid 1;
function FDFCreate: IDispatch; dispid 2;
function FDFOpenFromFile(const bstrFileName: WideString): IDispatch; dispid 3;
function FDFOpenFromBuf(varFdfData: OleVariant): IDispatch; dispid 4;
function FDFOpenFromStr(const bstrFdfData: WideString): IDispatch; dispid 5;
end;
// *********************************************************************//
// Interface: IFdfDoc
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {CB830892-2E18-11D1-B8CF-00A0C9259304}
// *********************************************************************//
IFdfDoc = interface(IDispatch)
['{CB830892-2E18-11D1-B8CF-00A0C9259304}']
procedure FDFClose; safecall;
function FDFGetValue(const bstrFieldName: WideString): WideString; safecall;
procedure FDFSaveToFile(const bstrFileName: WideString); safecall;
function FDFSaveToBuf: OleVariant; safecall;
function FDFNextFieldName(const bstrFieldName: WideString): WideString; safecall;
procedure FDFSetValue(const bstrFieldName: WideString; const bstrNewValue: WideString;
isName: WordBool); safecall;
function FDFGetStatus: WideString; safecall;
procedure FDFSetStatus(const bstrNewStatus: WideString); safecall;
function FDFGetFile: WideString; safecall;
procedure FDFSetFile(const bstrNewFile: WideString); safecall;
function FDFGetID(nElemNum: Smallint): WideString; safecall;
procedure FDFSetID(nElemNum: Smallint; const bstrElem: WideString); safecall;
function FDFGetOpt(const bstrFieldName: WideString; nElemNum: Smallint; bFirstString: WordBool): WideString; safecall;
function FDFGetOptNumElem(const bstrFieldName: WideString): Smallint; safecall;
procedure FDFSetOpt(const bstrFieldName: WideString; nElemNum: Smallint;
const bstr1: WideString; const bstr2: WideString); safecall;
function FDFGetFlags(const bstrFieldName: WideString; whichFlags: Smallint): Integer; safecall;
procedure FDFSetFlags(const bstrFieldName: WideString; whichFlags: Smallint; newFlags: Integer); safecall;
procedure FDFSetAP(const bstrFieldName: WideString; whichFace: Smallint;
const bstrFileName: WideString; pageNum: Smallint); safecall;
procedure FDFSetAS(const bstrFieldName: WideString; const bstrNewAS: WideString); safecall;
procedure FDFSetSubmitFormAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheURL: WideString; theFlags: Integer;
rgFields: OleVariant); safecall;
procedure FDFSetResetFormAction(const bstrFieldName: WideString; whichTrigger: Smallint;
theFlags: Integer; rgFields: OleVariant); safecall;
procedure FDFGetAP(const bstrFieldName: WideString; whichFace: Smallint;
const bstrFileName: WideString); safecall;
procedure FDFSetAPRef(const bstrFieldName: WideString; whichFace: Smallint;
const bstrFileName: WideString; const bstrTemplateName: WideString); safecall;
procedure FDFSetIF(const bstrFieldName: WideString; scaleWhen: Smallint;
bProportional: WordBool; x: Single; y: Single); safecall;
procedure FDFSetImportDataAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheFile: WideString); safecall;
procedure FDFSetGoToAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheDest: WideString; isName: WordBool); safecall;
procedure FDFSetJavaScriptAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheScript: WideString); safecall;
procedure FDFSetGoToRAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheDest: WideString; isName: WordBool;
const bstrTheFile: WideString; addNewWindow: WordBool;
newWindow: WordBool); safecall;
procedure FDFSetURIAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheURI: WideString; isMap: WordBool); safecall;
procedure FDFSetNamedAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheName: WideString); safecall;
procedure FDFSetHideAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheTarget: WideString; isHide: WordBool); safecall;
procedure FDFSetStateAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheTarget: WideString; const bstrTheAS: WideString); safecall;
procedure FDFRemoveItem(const bstrFieldName: WideString; whichItem: Smallint); safecall;
procedure FDFAddTemplate(bNewPage: WordBool; const bstrFileName: WideString;
const bstrTemplateName: WideString; bRename: WordBool); safecall;
function FDFSaveToStr: WideString; safecall;
function FDFGetEncoding: WideString; safecall;
procedure FDFSetEncoding(const bstrNewEncoding: WideString); safecall;
function FDFGetFDFVersion: WideString; safecall;
procedure FDFSetFDFVersion(const bstrVersion: WideString); safecall;
function FDFGetNthValue(const bstrFieldName: WideString; whichValue: Smallint): WideString; safecall;
procedure FDFSetTargetFrame(const bstrTargetFrame: WideString); safecall;
procedure FDFAddDocJavaScript(const bstrScriptName: WideString; const bstrScript: WideString); safecall;
procedure FDFSetOnImportJavaScript(const bstrScript: WideString; bBefore: WordBool); safecall;
function FDFOpenFromEmbedded(iEmbeddedFDF: Smallint; const bstrPassword: WideString): IDispatch; safecall;
procedure FDFEmbedAndClose(const pFDFToEmbed: IFdfDoc; const bstrPassword: WideString); safecall;
function FDFExtractAttachment(const bstrFieldName: WideString; var pbstrFileName: WideString;
bIsFilePath: WordBool): WideString; safecall;
procedure FDFExtractAppendSaves(const bstrDestFileName: WideString); safecall;
procedure FDFSetValues(const bstrFieldName: WideString; arrValues: OleVariant); safecall;
function FDFGetRichValue(const bstrFieldName: WideString): WideString; safecall;
procedure FDFSetRichValue(const bstrFieldName: WideString; const bstrNewValue: WideString;
isName: WordBool); safecall;
end;
// *********************************************************************//
// DispIntf: IFdfDocDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {CB830892-2E18-11D1-B8CF-00A0C9259304}
// *********************************************************************//
IFdfDocDisp = dispinterface
['{CB830892-2E18-11D1-B8CF-00A0C9259304}']
procedure FDFClose; dispid 1;
function FDFGetValue(const bstrFieldName: WideString): WideString; dispid 2;
procedure FDFSaveToFile(const bstrFileName: WideString); dispid 3;
function FDFSaveToBuf: OleVariant; dispid 4;
function FDFNextFieldName(const bstrFieldName: WideString): WideString; dispid 5;
procedure FDFSetValue(const bstrFieldName: WideString; const bstrNewValue: WideString;
isName: WordBool); dispid 6;
function FDFGetStatus: WideString; dispid 7;
procedure FDFSetStatus(const bstrNewStatus: WideString); dispid 8;
function FDFGetFile: WideString; dispid 9;
procedure FDFSetFile(const bstrNewFile: WideString); dispid 10;
function FDFGetID(nElemNum: Smallint): WideString; dispid 11;
procedure FDFSetID(nElemNum: Smallint; const bstrElem: WideString); dispid 12;
function FDFGetOpt(const bstrFieldName: WideString; nElemNum: Smallint; bFirstString: WordBool): WideString; dispid 13;
function FDFGetOptNumElem(const bstrFieldName: WideString): Smallint; dispid 14;
procedure FDFSetOpt(const bstrFieldName: WideString; nElemNum: Smallint;
const bstr1: WideString; const bstr2: WideString); dispid 15;
function FDFGetFlags(const bstrFieldName: WideString; whichFlags: Smallint): Integer; dispid 16;
procedure FDFSetFlags(const bstrFieldName: WideString; whichFlags: Smallint; newFlags: Integer); dispid 17;
procedure FDFSetAP(const bstrFieldName: WideString; whichFace: Smallint;
const bstrFileName: WideString; pageNum: Smallint); dispid 18;
procedure FDFSetAS(const bstrFieldName: WideString; const bstrNewAS: WideString); dispid 19;
procedure FDFSetSubmitFormAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheURL: WideString; theFlags: Integer;
rgFields: OleVariant); dispid 20;
procedure FDFSetResetFormAction(const bstrFieldName: WideString; whichTrigger: Smallint;
theFlags: Integer; rgFields: OleVariant); dispid 21;
procedure FDFGetAP(const bstrFieldName: WideString; whichFace: Smallint;
const bstrFileName: WideString); dispid 22;
procedure FDFSetAPRef(const bstrFieldName: WideString; whichFace: Smallint;
const bstrFileName: WideString; const bstrTemplateName: WideString); dispid 23;
procedure FDFSetIF(const bstrFieldName: WideString; scaleWhen: Smallint;
bProportional: WordBool; x: Single; y: Single); dispid 24;
procedure FDFSetImportDataAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheFile: WideString); dispid 25;
procedure FDFSetGoToAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheDest: WideString; isName: WordBool); dispid 26;
procedure FDFSetJavaScriptAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheScript: WideString); dispid 27;
procedure FDFSetGoToRAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheDest: WideString; isName: WordBool;
const bstrTheFile: WideString; addNewWindow: WordBool;
newWindow: WordBool); dispid 28;
procedure FDFSetURIAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheURI: WideString; isMap: WordBool); dispid 29;
procedure FDFSetNamedAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheName: WideString); dispid 30;
procedure FDFSetHideAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheTarget: WideString; isHide: WordBool); dispid 31;
procedure FDFSetStateAction(const bstrFieldName: WideString; whichTrigger: Smallint;
const bstrTheTarget: WideString; const bstrTheAS: WideString); dispid 32;
procedure FDFRemoveItem(const bstrFieldName: WideString; whichItem: Smallint); dispid 34;
procedure FDFAddTemplate(bNewPage: WordBool; const bstrFileName: WideString;
const bstrTemplateName: WideString; bRename: WordBool); dispid 35;
function FDFSaveToStr: WideString; dispid 36;
function FDFGetEncoding: WideString; dispid 37;
procedure FDFSetEncoding(const bstrNewEncoding: WideString); dispid 38;
function FDFGetFDFVersion: WideString; dispid 39;
procedure FDFSetFDFVersion(const bstrVersion: WideString); dispid 40;
function FDFGetNthValue(const bstrFieldName: WideString; whichValue: Smallint): WideString; dispid 41;
procedure FDFSetTargetFrame(const bstrTargetFrame: WideString); dispid 42;
procedure FDFAddDocJavaScript(const bstrScriptName: WideString; const bstrScript: WideString); dispid 43;
procedure FDFSetOnImportJavaScript(const bstrScript: WideString; bBefore: WordBool); dispid 44;
function FDFOpenFromEmbedded(iEmbeddedFDF: Smallint; const bstrPassword: WideString): IDispatch; dispid 45;
procedure FDFEmbedAndClose(const pFDFToEmbed: IFdfDoc; const bstrPassword: WideString); dispid 46;
function FDFExtractAttachment(const bstrFieldName: WideString; var pbstrFileName: WideString;
bIsFilePath: WordBool): WideString; dispid 47;
procedure FDFExtractAppendSaves(const bstrDestFileName: WideString); dispid 48;
procedure FDFSetValues(const bstrFieldName: WideString; arrValues: OleVariant); dispid 49;
function FDFGetRichValue(const bstrFieldName: WideString): WideString; dispid 50;
procedure FDFSetRichValue(const bstrFieldName: WideString; const bstrNewValue: WideString;
isName: WordBool); dispid 51;
end;
// *********************************************************************//
// The Class CoFdfApp provides a Create and CreateRemote method to
// create instances of the default interface IFdfApp exposed by
// the CoClass FdfApp. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoFdfApp = class
class function Create: IFdfApp;
class function CreateRemote(const MachineName: string): IFdfApp;
end;
// *********************************************************************//
// The Class CoFdfDoc provides a Create and CreateRemote method to
// create instances of the default interface IFdfDoc exposed by
// the CoClass FdfDoc. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoFdfDoc = class
class function Create: IFdfDoc;
class function CreateRemote(const MachineName: string): IFdfDoc;
end;
implementation
uses ComObj;
class function CoFdfApp.Create: IFdfApp;
begin
Result := CreateComObject(CLASS_FdfApp) as IFdfApp;
end;
class function CoFdfApp.CreateRemote(const MachineName: string): IFdfApp;
begin
Result := CreateRemoteComObject(MachineName, CLASS_FdfApp) as IFdfApp;
end;
class function CoFdfDoc.Create: IFdfDoc;
begin
Result := CreateComObject(CLASS_FdfDoc) as IFdfDoc;
end;
class function CoFdfDoc.CreateRemote(const MachineName: string): IFdfDoc;
begin
Result := CreateRemoteComObject(MachineName, CLASS_FdfDoc) as IFdfDoc;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment