PREVIOUS HEAD

15  Enhanced Special-Handling in 32-bit Edition

(First available in 4.0L.) We have modified and enhanced the rendering calls to the special() function of 32-bit special-handler DLL's. While in WIN16 applications one can pass file stream pointers to DLL's, in WIN32 this is not always possible. Thus the ``f'' parameter (a FILE * pointer) which DVIGDI32.EXE provides to special() handler functions is modified as follows: this pointer will be NULL unless the '134special text is lengthy (currently, ``lengthy'' means ³ 1024 characters), in which case the pointer will be (on auction and rendering calls) a memory-mapped pointer for the underlying DVI file.

That is, the handler function may use the pointer plus an offset between offset to offset+total_len-1 to access the full text of a lengthy '134special.

15.1  Accessing Memory-Mapped Special-Texts

Note also the following cautions:

15.2  Messages from special handlers

Formerly, '134special handlers have been prohibited from displaying message boxes because they are called inside a previewer WM_PAINT. One disadvantage to this limitation is that debugging handlers is very difficult, since handlers cannot display debugging information interactively. A new feature in this release allows '134special handlers to pass texts to the previewer for display in a message window. The handler should #include the header file regmsg.h, and then can send informational texts for display to the previewer via a message to the document window with a statement similar to this:

if (hWnd) SendMessage(hWnd,IPRINTF_MESSAGE,0,
(LPARAM)"spcolr: Hello");

where hWnd is the window handle passed to the special() function in the '134special handler (that is, the second parameter to special). (In WIN16 compilations, you will need to follow the cast to (LPARAM) with a cast to (char far *) in small-model code.) The previewer will display the string addressed by the LPARAM parameter. Take care not to generate such messages on every rendering pass, since this can result in numerous messages.


NEXT HEAD