Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use hDC for Printing Active-X Controls
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Use hDC for Printing Active-X Controls
Miscellaneous
Thread ID:
00249021
Message ID:
00249021
Views:
64
First off, thank you all for being here. I have lurked for a very long time and have been able to find the answers to my questions using the knowledge base or the search engine. You are all greatly appreciated.

Now down to my problem. We have developed an EIS app using VFP6.0 that uses remove views to query accounting data and provide a "close to real time" graphing analysis of sales data. We are using ChartFX98 for the graphing. ChartFX98 is an ActiveX control.

One of our screens has 3 graphs on it. We want to print them all on one page. I'd like to put them in general fields and simply print them, but a quick email to ChartFX tech support got us this answer:

----------
Dear Bill,

Unfortunately, ActiveX support in VFP reports is rather weak as it doesn't support ActiveX controls.

There is a method in Chart FX that allows you to print multiple charts in a page (Paint method) but it requires a Device Context for the printer page that is not obtainable from FoxPro's API.

It can be obtained using Windows API.
-----------

The help file in ChartFX has an example of the VB code to accomplish what we are trying to do. We haven't worked with Win32API calls. Can anyone give us an example of the syntax in VFP to duplicate the funtionality of the VB Code below?

Sub PrintFillingPage ()
Dim l, r, t, b As Integer 'left,right,top and bottom
Printer.Print ""
px = Printer.TwipsPerPixelX
py = Printer.TwipsPerPixelY
w = Printer.Width
h = Printer.Height
gap = 100 / px
t = gap
b = ((h / 2) / py) - gap
l = gap
r = (w / px) - gap / 2
ChartFX1.Paint Printer.hDC, l, t, r, b, CPAINT_PRINT, 0
t = b
b = (h / py) - gap
ChartFX1.Paint Printer.hDC, l, t, r, b, CPAINT_PRINT, 0
Printer.EndDoc
End Sub


Thanks!
Bill Dimes
Regards,

Bill Dimes

"There's never enough time to do it right the first time, but there's always time to do it over"
Next
Reply
Map
View

Click here to load this message in the networking platform