Home|Download|Buy online|Affiliates|Search|Feedback|Site Map|Forum|Reviews|Hall of ShameUse our online RSS & XML news feeds to get the latest news about our products delivered to your desktop... RSS feed    20.11.2008
Home»Print preView Library»SDK
Find out more how to use BestView...
Structures

Structures

ATTENTION!
The library has been superseded by our new product, BestView library. BestView offers a lot of new features, such as multilanguage support, new exact coordinate system, dynamic pages and so on.
Find a minute and visit BestView home page.

struct PVL_CALLBACK
    {
    DWORD dwSize;
    LPVOID lpUserData ;
    HRESULT (__stdcall* pfnPrepareDC) (PVL_CALLBACK*,HWND,DEVMODEA *,LONG );
    HRESULT (__stdcall* pfnInit) (PVL_CALLBACK *,HWND,HDC,const DEVMODEA *);
    HRESULT (__stdcall* pfnGetNumPages) (PVL_CALLBACK *,HWND,const DEVMODEA *,LONG *);
    HRESULT (__stdcall* pfnDrawPage) (PVL_CALLBACK *,HWND,HDC,DWORD,DWORD );
    HRESULT (__stdcall* pfnCanBeClosed) (PVL_CALLBACK *,HWND,LONG *);
    HRESULT (__stdcall* pfnWindowCutOff)(PVL_CALLBACK *,HWND );
    HRESULT (__stdcall * pfnPrintDisabled)(PVL_CALLBACK *, HWND );
    LPCSTR pszWindowName;
    LPCSTR pszDocumentName;
    DWORD dwStyleEx ;
    DWORD dwStyle ;
    DWORD dwInitialWindowWidth ;
    DWORD dwInitialWindowHeight ;
    HWND hParentWindow;
    HINSTANCE hInstance;
    DWORD dwShowStyle;
    };

Members:

dwSize;

[in] - this is the size of the structure PVL_CALLBACK. (= sizeof(PVL_CALLBACK))

lpUserData;

[in] - a pointer to user data. Usually is used by a PVL_CALLBACK wrapper to route messages between different instances of preview windows.

pfnPrepareDC;

[in] - a pointer to a callback function that is called by a print preview window every time when current printer is changing. The function must have following declaration:

HRESULT __stdcall fnPrepareDC(PVL_CALLBACK* pPvlCallback,HWND hwnd,DEVMODEA * pPreCreatedDevMode,LONG lFromInit );

Parameters:

pPvlCallback;

[in] - pointer to the structure that is passed in the exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

pPreCreatedDevMode;

[in/out] - a pointer to DEVMODEA internal structure. User can change any parameters in structure. This structure used later inside library for creating a device context.

lFromInit;

[in] - a boolean flag. The nonzero value shows that the this call is caused by changing printer properties. Zero value appears during initial window's creation.

pfnInit;

[in] - a pointer to a callback function that is called by a print preview window when the device context has been created. This is a place to build  a content of pages. The function must have following declaration:

HRESULT __stdcall fnInit (PVL_CALLBACK * pPvlCallback,HWND hwnd,HDC dc,const DEVMODEA * pCreatedDevMode);

Parameters:

pPvlCallback;

[in] - a pointer to a structure passed in the exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

dc;

[in] - the device context created for output. User can get device's parameters with the  GetDeviceCaps function.

pCreatedDevMode;

[in] - a pointer to the DEVMODEA structure on the basis of which thedevice context has been created.

pfnGetNumPages;

[in] - a pointer to a callback function that is called by a print preview window when the device context has been created. The function must have following declaration:

HRESULT __stdcall fnGetNumPages(PVL_CALLBACK * pPvlCallback,HWND hwnd,const DEVMODEA * pCreatedDevMode,LONG* lNumPages);

Parameters:

pPvlCallback;

[in] - a pointer to a structure passed in exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

pCreatedDevMode;

[in] - a pointer to the DEVMODEA structure on basis of which thedevice context has been created.

lNumPages;

[in/out] - a pointer to a LONG value in which the user has to write an actual number of pages to draw.

pfnDrawPage;

[in] - a pointer to a callback function that is called by a print preview window when a page needs to be drawn. The function must have following declaration:

HRESULT __stdcall fnDrawPage (PVL_CALLBACK * pPvlCallback,HWND hwnd,HDC dc,DWORD dwPageNumber,DWORD dwIsPrinter);

Parameters:

pPvlCallback;

[in] - a pointer to a structure that is passed in exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

dc;

[in] - this is the device context for drawing. User have to draw at this point.

dwPageNumber;

[in] - the number of page to draw. First page has number zero.

dwIsPrinter;

[in] - A token. 0 if page is drawing on a screen, 1 if the page is drawing on a printer. Useful to draw watermarks.

pfnCanBeClosed;

[in] - a pointer to a callback function that is called by a print preview window when the user is trying to close the print preview window. The function must have following declaration:

HRESULT __stdcall fnCanBeClosed(PVL_CALLBACK * pPvlCallback,HWND hwnd,LONG * plCanBeClosed);

Parameters:

pPvlCallback;

[in] - a pointer to the structure that is passed in the exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

plCanBeClosed;

[in/out] - a pointer to a LONG value. The user has to set this value to the zero if  closing is disallowed, or to the a nonzero value in another case.

pfnWindowCutOff;

[in] - a pointer to a callback function that is called by a print preview window when the window is closed. It is  last call through the passed pointer to the structure PVL_CALLBACK. At this point user can free any resources that have been allocated for this preview window. The function must have following declaration:

HRESULT __stdcall fnWindowCutOff(PVL_CALLBACK * pPvlCallback,HWND hwnd);

Parameters:

pPvlCallback;

[in] - a pointer to a structure passed in the exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

pfnPrintDisabled;

[in] - a pointer to a callback function that is called by a print preview window to print the preview content or output it to an image file when this output is disabled by pvlDisablePrint function call. This is useful when you create an evaluation version of your application. The function must have following declaration:

HRESULT __stdcall pfnPrintDisabled(PVL_CALLBACK * pPvlCallback,HWND hwnd);

Parameters:

pPvlCallback;

[in] - a pointer to a structure passed in the exported function pvlCreatePreview.

hwnd;

[in] - deprecated, not for use.

ppszWindowName;

[in] - a pointer to a string which contains a window caption. This pointer must be actual during all window's life cycle.

pszDocumentName

[in] - a pointer to a string which contains a document name (a print job name). This pointer must be actual during all window's life cycle.

dwStyleEx;

[in] - an extended window style, it is used for preview's creation. For overlapped windows ( like MS Word�) that can be set in WS_EX_APPWINDOW.

dwStyle;

[in] - a window style, it is used for preview's creation. For overlapped windows ( like MS Word�) that can be set in

WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|
WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX
.

dwInitialWindowWidth;

[in] - an initial window width, in pixels.

dwInitialWindowHeight;

[in] - an initial window height, in pixels.

hParentWindow;

[in] - a handle of a parent window, or zero.

hInstance;

[in] - HINSTANCE for which the preview window is creating.

dwShowStyle;

[in] - an initial show style. For example, SW_SHOWMAXIMIZED

Valid HTML 4.01 Transitional© PVL team, 2004-2008, all rights reserved. This Web site and its entire contents are for personal use only and may not be copied, reproduced, modified, published or distributed in any way,without PVL team's prior written permission.