Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use hDC for Printing Active-X Controls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Use hDC for Printing Active-X Controls
Divers
Thread ID:
00249021
Message ID:
00249021
Vues:
65
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"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform