Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer.hDC equivalent in VFP

Status
Not open for further replies.

LindaRichard

Programmer
Feb 23, 2001
103
0
0
CA
I have an OCX control called Metadraw.
This allows me draw and edit graphs.

In Visual Basic to print the content of the control (MDdraw) I would type

Printer.Print ""
MDdraw.ExportDC=Printer.hDC
Printer.Newpage
Printer.Enddoc

The code
SET Printer ON
SET printer OFF
does result in a page feed.

The problem is the Printer.hDC
Anyone have any suggestions on the VFP equivalent?

Thanks for your help.

Linda
 
Linda,
I saved this code off from one of the newsgroups - it was written by Anders Altberg. While it's to print the contents of an RTF ActiveX control, I believe it may give you a starting place.
Code:
DECLARE INTEGER CreateDC IN Win32Api STRING, STRING, INTEGER, INTEGER
DECLARE INTEGER DeleteDC IN Win32Api INTEGER

cPrinter = Set("PRINTER",3)
hDC = CreateDC("WINSPOOL",cPrinter,0,0)
ThisForm.AxRTF.SelPrint(hDC)
DeleteDC(hDC)

-Anders
Rick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top