473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Where is the hDC of the PrintDocument.

Hello,

I have an OCX control on my WinForm (don't ask, i have to use it) and it
generally works well. One of the methods of the OCX prints to an hDC
(device context handle for history buffs). Seeing how everything in
..NET prints to a PrintDocument object, I was wondering how I can
retrieve the hDC of the PrintDocument? Or am I looking in the wrong place?
Nov 16 '05 #1
1 2384
In the PrintEvent of the PrintDocument, the PrintPageEventArgs parameter
has a Graphics property which has a method called GetHdc() which you can
use to get the HDC of the PrintDocument.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

Frank Rizzo wrote:
Hello,

I have an OCX control on my WinForm (don't ask, i have to use it) and it
generally works well. One of the methods of the OCX prints to an hDC
(device context handle for history buffs). Seeing how everything in
.NET prints to a PrintDocument object, I was wondering how I can
retrieve the hDC of the PrintDocument? Or am I looking in the wrong place?

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeffry van de Vuurst | last post by:
Hi, I have a PrintDocument that I preview in a PrintPreviewControl. Now I run the app on a pc without any printers installed and when I want to preview the PrintDocument I get an...
3
by: Palli Olafs | last post by:
Hi Is it possible to save the PrintDocument as file without using a printer?
3
by: Randy | last post by:
Hello, I'm trying to print a dataGrid using PrintDocument control. My datagrid has about 23 columns so it is fairly wide. When I use the PrintControl, it prints only the part of the dataGrid that...
2
by: Robert Hooker | last post by:
Hi, I'm curious to know if I'm doing something wrong here, or if this is just mind-numbingly slow for a reason. In a simple WindowsFormsApplication: public Form1() { // Required for...
1
by: john sutor | last post by:
I am trying to print a simple document (.txt) from my drive. I tried using the following code to no avail. This cannot be that hard. In VB this was easy, Why does C# make it so hard? Can anyone...
0
by: active | last post by:
Dim mPD As PrintDocument Dim mPrinternameSaved As PrintDocument Public WriteOnly Property PrintDocument() As PrintDocument Set(ByVal value As PrintDocument) mPD = value mPrinternameSaved = mPD...
3
by: Mika M | last post by:
Hi all! I have made an application for printing simple barcode labels using PrintDocument object, and it's working fine. Barcode printer that I use is attached to the computer, and this...
2
by: Steve | last post by:
I'm trying real hard to set the printer resolution for a PrintDocument. It appears that the printer is already set to 300 x 300 dpi, which is JUST what I want. But the Margins and PrintableArea...
2
by: bp | last post by:
Hi, I try to use my own PreviewDialog with a PrinPreviewControl, to preview a document of type MyPrintDocument, and I want to implement the PrintRange functionnality (print some pages between 2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.