Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DocumentProperties anyone?
Message
 
To
02/05/2005 15:11:53
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01010251
Message ID:
01010283
Views:
22
Thanks, Christian! You've found the missing link! The piece I was missing was sending the orginal devmode as the second pdevmode parameter. The example I found at http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q167345 said:

/*
* Step 2:
* Get the default DevMode for the printer and
* modify it for your needs.
*/
dwRet = DocumentProperties(hWnd,
hPrinter,
pDevice,
pDevMode, /* The address of the buffer to fill. */
NULL, /* Not using the input buffer. */
DM_OUT_BUFFER); /* Have the output buffer filled. */
if (dwRet != IDOK)
{
/* If failure, cleanup and return failure. */
free(pDevMode);
ClosePrinter(hPrinter);
return NULL;
}


which is what threw me off.


>Hello,
>
>excerpt from MSDN:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_7k1f.asp
>
>LONG DocumentProperties(
> HWND hWnd, // handle to parent window
> HANDLE hPrinter, // handle to printer object
> LPTSTR pDeviceName, // device name
> PDEVMODE pDevModeOutput, // modified device mode
> PDEVMODE pDevModeInput, // original device mode
> DWORD fMode // mode options
>);
>
>fMode Description:
>......
>DM_IN_PROMPT Input value. The function presents the printer driver's Print Setup property sheet and then changes the settings in the !!!! printer's !!!! DEVMODE data structure to those values specified by the user. This value is also defined as DM_PROMPT.
>.......
>
>to me this means that the settings aren't updated in the PDEVMODE parameters but instead directly written to the global printer configuration
>
>so you will probably just want to call DocumentProperties once to let the user change the settings in the dialog and then directly call it again with fMode set to DM_OUT_BUFFER to read out the settings the user just made ..
>
>Regards
>Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform