Creating New Host Function Tables - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
DURING
//Create an HFT callback function
provideMyHFTCallback = ASCallbackCreateProto(HFTServerProvideHFTProc,
&ProvideMyHFT);
//Create an HFT server
gMyHFTServer = HFTServerNew("MyHFT", provideMyHFTCallback,
NULL, NULL);
HANDLER
gSomethingWentWrong=1;
return false;
END_HANDLER
return true;
}
Note:
In the previous code example, the
variables are declared as global variables. To view the complete code example, including the
location of where these global variables are declared, see
on page

Creating new Host Function Tables

You can create a new HFT by performing the following tasks within the HFT callback function that you
define:
1. Create an
and the number of entries in the new HFT as arguments. The number of entries determines how many
methods that the HFT contains. Each method occupies one entry.
2. Invoke the
HFT methods. This method requires the following arguments:
An HFT object that you want to populate.
The entry in the
enumeration that you created. For example, you can specify
"Creating HFT method definitions" on page
An
can, for example, reference the
ASCallbackCreateReplacement
The new entry's properties. Currently, only
You must invoke the
example, if you expose three methods through the HFT, then you invoke the
three times.
The following code example shows the syntax of the
function defined in the previous section. Within this method, a new HFT is created. For information about
HFT callback methods, see
170.
object by invoking the
HFT
HFTReplaceEntry
object to replace. You can specify an index value that is specified in the
HFT
object that represents a method that will become available through the HFT. You
HFTEntry
ASCallbackCreateReplacement(BeepTwiceSEL,&BeepTwiceImplementation)
HFTReplaceEntry
"Creating HFT callback functions" on page
,
gMyHFT
gMyHFTServer
method. This method requires an
HFTNew
method to populate the entries in the
166.
BeepTwiceImplementation
method, as shown in the following example:
HFTEntryReplaceable
method for each method that you expose through the HFT. For
ProvideMyHFT
Working with Host Function Tables
Creating new Host Function Tables
, and
gSomethingWentWrong
"Examining HFT header and source files"
HFTServer
object with pointers to the
HFT
. For information, see
BeepTwiceSEL
method by passing the
is defined.
HFTReplaceEntry
method, which is the HFT callback
168.
169
object
method

Advertisement

Table of Contents
loading

Table of Contents