Notes for Windows developers

To build plug-ins for Windows, you need:

PageMaker for Windows requires that a plug-in:

Creating the registration resource

Registration information is stored in an ADNI resource. PageMaker reads the ADNI resource of each plug-in at start-up. Briefly, PageMaker needs to know:

The file ADNI.rc contains the definitions, declarations, and structures you need to create the ADNI resource. When PageMaker is started, it reads this data to register the plug-in.

Note: When you open ADNI.rc in the MS Visual C++ Integrated Development Environment, change the Open As option in the Open dialog box from Auto to Text. This allows you to edit the registration resource. Otherwise, the resource file will appear as if it is an empty resource file.

Example:

/**********************************************************************
 * ADNI.RC ADNI Resource for PageMaker plug-ins.
 *
 * Copyright (C) 1993-1997 Adobe Systems Incorporated.  All rights reserved.
 *
 * ABSTRACT:
 *              This resource file must contain a RI_REGINFO ADNI resource.
 *				This resource file should be added to your projects in the 
 *			"View/Resource Includes" menu, under "read-only resources".
 *
 ************************************************************************/

#ifndef APSTUDIO_INVOKED // The app studio editor would wipe out the comments

// These are the codes for Addition Resources:
#define RI_REGINFO 101
#define ADNI 301

// This is the declaration of the RI_REGINFO ADNI resource.
RI_REGINFO ADNI MOVEABLE //101 301
// Header:
	BEGIN
	0L          // values can be combined (0x0003 for register and stay in memory).
				// 0x0001 kStayInMem  
				// 0x0002 kRegister
				// 0x0004 kDisablePMEvent
				// 0x0008 kDisablePMSysEvent
				// 0x0010 kDisableNonCQEvent 
	0x0300   	// Interface Version (3.0, in a WORD)
				// This needs to be version 3.0 for PM 6.5 and greater
	1           // number of plug-ins in DLL plug-in library (SHORT)
				// We strongly recommend limiting each DLL to 1 plug-in.

	// definition of plug-in number 1:
	1L              // string id# for menu name (DWORD)
	0x0L             // 1 if plug-in should appear in menu, 0 otherwise (unsigned long)
				// 0x04 if plug-in should be enabled in Layout state.
				// 0x08 if plug-in should be enabled in Story Edit state.
				// 0x10 if plug-in should be enabled in Nopub state.
				// To appear in menu for all states the value is 0x1DL.
	0x0100		// plug-in Version 1.00 (WORD) (your choice, but should match the
				//    version resource.
	0               // reserved (WORD)
	1L              // plug-in number. (The first plug-in get number 1) (LONG)
	0L              // reserved (LONG)

	END
#endif // not APSTUDIO_INVOKED

Microsoft Windows restrictions

On the PC, a plug-ins library is a standard Windows DLL and therefore must follow all the guidelines outlined for DLLs in the SDK Guide for Microsoft Windows and Windows NT.

Warning level 2 (Microsoft Visual C++ only). We highly recommend that you compile your code using at least warning level 2 (/W2) of the Microsoft Visual C++ compiler. Warning level 2 performs type checking on function arguments if you provide prototypes with argument types.

PC module-definition file

Every plug-in DLL compiled with Microsoft Visual C++, version 2, must have a module-definition file. The module-definition file is a text file that defines the contents and system requirements of a Windows DLL.

The module-definition file for a plug-in generally contains:

Note: List the function names only; do not attach ordinal numbers. If you include an ordinal number with the function name, Windows may not keep the function name resident. The function names must be resident, since PageMaker calls the functions by name.

Also note: Both main and the Windows entry procedure, DllMain, must be exported functions (either explicitly with the _export keyword or in the module definition file).

The module-definition file may have any name but must end with a .def file extension. The following example shows a typical module-definition file for a plug-in (in this case, for runscrip.add).

LIBRARY RUNSCRP
DESCRIPTION 'Run script plug-in'
HEAPSIZE 8192
CODE MOVEABLE DISCARDABLE LOADONCALL
DATA MOVEABLE SINGLE PRELOAD
EXPORTS
	main
	DllMain

For detailed information on the module-definition file, see the section on creating module-definition files in the SDK Guide for Microsoft Windows and Windows NT.

Project files

Project files for the sample plug-ins are included in this SDK. Refer to these when you create your project file.


Comments or suggestions? Contact Adobe Developer Support
Copyright © 1997 - 2001 Adobe Systems Incorporated. All rights reserved.
Legal notices and trademark attributions