Using Win32 functions in Visual FoxPro Image Gallery
Device Context
..msdn
ChangeDisplaySettings
CreateCompatibleDC
CreateDC
DeleteDC
DeleteObject
EnumDisplayDevices
EnumDisplaySettings
GetDC
GetDeviceCaps
GetObject
GetObjectType
ReleaseDC
SelectObject
Code examples:
Creating a device context for the specified printer
Printing Image File, programmatically set print page orientation to landscape
Printing text with the Escape function
CreateDC
..msdn    Add comment     W32 Constants      Translate this page
The CreateDC function creates a device context (DC) for a device using the specified name.
Code examples:
Printing Image File, programmatically set print page orientation to landscape
Printing text with the Escape function
Creating a device context for the specified printer
Declaration:
HDC CreateDC(
  LPCTSTR lpszDriver,        // driver name
  LPCTSTR lpszDevice,        // device name
  LPCTSTR lpszOutput,        // not used; should be NULL
  CONST DEVMODE* lpInitData  // optional printer data
);
FoxPro declaration:
DECLARE INTEGER CreateDC IN gdi32;
    STRING lpszDriver,;
    STRING lpszDevice,;
    INTEGER lpszOutput,;
    INTEGER lpInitData
Parameters:
lpszDriver
For various Windows this parameter can be NULL, or can contain a null-terminated string.

lpszDevice
[in] Pointer to a null-terminated character string that specifies the name of the specific output device being used.

lpszOutput
This parameter is ignored for Win32-based applications, and should be set to NULL.

lpInitData
[in] Pointer to a DEVMODE structure containing device-specific initialization data for the device driver.
Return value:
If the function succeeds, the return value is the handle to a DC for the specified device. If the function fails, the return value is NULL.
Usage:
* creating device context for a printer

hdc = CreateDC ("WINSPOOL",;
    "\\PRNSERVER01\REMOTEPRINTER002", 0, 0)

My comment:
The W2K Programming: the first way to obtain a printer device context is to use CreateDC function. The second way is to call PrintDlgEx function, which displays the Print common dialog box that allows the user to set various printing options.
Word Index links for the CreateDC :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-09-14 12:00:00
Modified: 2007-06-11 22:03:25
Visited in last 7 days: 31
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.166.199.178)
12 sec.Function: 'EnumForms'
26 sec.Function: 'GetPrintProcessorDirectory'
37 sec.Function: 'GetTcpTable'
50 sec.Function: 'CeGetSystemPowerStatusEx'
1.02 min.Function: 'GetPriorityClipboardFormat'
1.27 min.Function: 'WriteProcessMemory'
1.52 min.Function: 'GetStartupInfo'
1.75 min.Function: 'InternetSetFilePointer'
1.97 min.Function: 'GetLongPathName'
2.18 min.Function: 'IsPwrSuspendAllowed'
Google
Advertise here!