Macros And Project Settings; Interapplication Communication; Debugging - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications

Macros and project settings

The following macros must be defined or set in your preprocessor definitions:
WIN_ENV
WIN_PLATFORM (preferred)
WIN32
WINDOWS
For a plug-in to be loaded, it must export the symbol
including a .def file in the project for the plug-in or by including the line
project settings for the plug-in. If you are developing an Adobe Reader plug-in, you also must define a
macro to access HFTs available to Adobe Reader. For information, see
on page
245.

Interapplication communication

Plug-ins can add their own DDE messages to those supported by Acrobat or Adobe Reader, by registering
to receive DDE messages directly. The DDEClnt sample in the Acrobat SDK shows how to do this.
It is not possible for a plug-in to implement OLE automation or be an ActiveX server through the use of
MFC. This is because Acrobat or Adobe Reader uses MFC to implement its OLE automation and there
cannot be two MFC-based OLE automation servers in the same process. OLE or ActiveX server plug-ins
must be implemented using the ActiveX Template Library. Plug-ins should use the DDEML library to
handle DDE messages. Problems may arise if they do not.

Debugging

Generally, the debugger built into Visual C++ is adequate to debug plug-ins. Debugging a Windows
plug-in compiled with Visual C++ is quite simple if you remember a few things:
Specify the Acrobat plug-ins directory under the link | output tab in the Project settings dialog box.
Specify the Acrobat or Adobe Reader executable under the executable for debug session in the Project
settings dialog box.
The first time you build a plug-in, do a Rebuild All.
Set breakpoints in your source code by selecting the line and clicking the hand icon or pressing the F9
key.
After setting breakpoints, press the F5 key to have Microsoft Visual Studio launch Acrobat or Adobe
Reader.
Two common reasons why breakpoints may not be hit are:
You launched Acrobat or Adobe Reader from the File Manager or Program Manager. Acrobat or Adobe
Reader must be launched from with MSVC to debug plug-ins.
You copied your plug-in into Acrobat's plug-in directory, instead of specifying the plug-ins directory in
the link | output dialog box.
Creating Plug-in and PDF Library Applications
. This task can be accomplished by
PlugInMain
/EXPORT:PlugInMain
"Creating an Adobe Reader Plug-In"
Windows techniques
42
in the

Advertisement

Table of Contents
loading

Table of Contents