×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Chart not displaying correctly on laptop.

Chart not displaying correctly on laptop.

Chart not displaying correctly on laptop.

(OP)
I have a simple chart using mscomctl.OCX in my app. This works perfectly on my Dev PC.
However, when installed on my laptop I get a 'distorted' image where the components are 'bunched up' vertically - not in the usual correct spacing.
I have added this line in my Inno script
Source: mypath_Dist\mscomctl.OCX; DestDir: "{sys}"; Flags: regserver ignoreversion;
Any ideas why this might be happening?
GenDev

RE: Chart not displaying correctly on laptop.

The fact that the chart is being displayed - albeit incorrectly - suggests that the OCX has been properly installed and registered. If that was not the case, you would have seen an error message. So don't look to Inno for the cause.

A more likely possibility would be DPI awareness. Try putting this near the start of your main program:

CODE

DECLARE INTEGER SetProcessDPIAware IN WIN32API
SetProcessDPIAware() 

However, if that doesn't solve the problem, remove it, as it cold cause unwanted side effects elsewhere.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Chart not displaying correctly on laptop.

(OP)
Hi Mike,

Sadly that didn't create any change - removed form code in Main.prg

Gendev

RE: Chart not displaying correctly on laptop.

It could still be related to different DPI resolutions on Dev PC and laptop. Todays laptops often come with HD or even UHD/XHD displays with high DPI rates, unlike VFP, which reacts to SetProcessDpiAware rendering fonts accordingly, OCXes usually have their own settings about that.

Change the font sizes up when you detect high DPI displays. That is, if the resolution is higher than usual, set up the font sizes used in the chart.

Chriss

RE: Chart not displaying correctly on laptop.

(OP)
Hi Chriss,

The laptop is an older model.

DEV PC runs at dual 1920x1080 and the laptop 1280 x 768

Regards
GenDev

RE: Chart not displaying correctly on laptop.

Okay, can you post screenshots of the charts from PC and laptop?

Chriss

RE: Chart not displaying correctly on laptop.

(OP)
Hi Chriss,


Here are the pic files

RE: Chart not displaying correctly on laptop.

Okay, that can't be explained with dpi resolutions at all.

Arte there some default settings stored in the registry (the registry is not only storing informations about OCXs themeselves, but also settings)? I think so, or some INI files, or other sources, that determine how the column captions are rendered. Anything, that can differ on pc vs laptop, but as Mike already said, the mere registering of the OCX is done, otherwise you wouldn't see a chart at all.

There are Ole control specific properties you can set that are not store in VFPs property memo, but in an Ole memo in a form or clas record, so they will come over from pc to notebook, once you have the same sources or same EXE there, so I'd just give it a go to build a new EXE, bring it over to the notebook and use it there. Be aware that overwriting an EXE in a system directory like Program Files with UAC on would redirect that to VirtualStore and not indeed overwrite the EXE a setup could put there. So to update an EXE, either turn UAC off or let a setup do the EXE update.

Chriss

RE: Chart not displaying correctly on laptop.

(OP)
Hi Chriss,
Y have uninstalled/reinstalled my program on the laptop countless times using the uninstall/install exe provided by Inno. Thus the exe is the same on both computers.
I didn't think my ini file held any items that impacted on the graph.
I'll have to investigate whether it is possible to 'prime' the control.

Thanks

GenDev

RE: Chart not displaying correctly on laptop.

Hello,

I agree, it seems to be a DPI effect.

is that effect in other programs, too ?
Do you use the laptop in native resolution ?
You may try to change dpi to 100% and "play" with "Cleartype"


Regards
tom

RE: Chart not displaying correctly on laptop.

I think the "Person, Event, Source" etc texts are "Footnotes", right? In the MS Chart Properties you will set them to be vertical or horizontal besides other settings. That has nothing to do with DPI.

Chriss

RE: Chart not displaying correctly on laptop.

Hmm...

A first question is how gendev create chart picture because mscomctl.OCX don't contains a class for creating picture.

mJindrova

RE: Chart not displaying correctly on laptop.

(OP)


Hi mJindrova

I used the snipping toll in WIN 11

GenDev

RE: Chart not displaying correctly on laptop.

(OP)
Chriss,
This is the view I have in the IDE of the form I use with the control inserted and my text added - this may not be the correct way to do it but that's what I used.



GenDev

RE: Chart not displaying correctly on laptop.

(OP)
Of interest
The graph shows the same on my wife's Toshiba Laptop - much later C1999 vintage.

GenDev

RE: Chart not displaying correctly on laptop.

You choose what you want in OLE p├╝roperties:

But you can only see thise, when you design a visual form (VCX/SCX), not if you stick to writing PRG code:

That's where you configure what chart type to draw, how captions/titles/legend/footnote text is rendered etc.

Chriss

RE: Chart not displaying correctly on laptop.

'You mnay also get more guidance, if you post the code you use to create thise charts. If your code is limited to defining the data series, your own experience shows you get "random" results in chart types, captions, etc. because you most likely don't explicitly set all that as you don't know how. We, as "normal" VFP developers would use these visual designer options available to us, that are not available when you do everything programmatically.

We had that discussion already, your coide is all PRG and you need to maintain and extend that. It doesn't hinder you to do new things withvisual designers, you cannot only do whol forms, you can base a class on container or even on the control base class and add that as object into your PRG code, too.

Chriss

RE: Chart not displaying correctly on laptop.

(OP)
Chriss,
You said ' your code is all PRG '.
Well I have over 50 forms and 220 prg files in my application.
The chart control is used in a form and was made over 15 years ago.
I now see the properties you mention and I will experiment with some of the options there.

Regards
GEnDev

RE: Chart not displaying correctly on laptop.

You madfe the impression you're having all prg code in your thread184-1829540: Modifying a character field in a grid to cause an action.
Okay, if you use the Ms Chart control on an scx form then you now know where to make some OCX specific settings. In general, things you can configure in these property dialogs of an OCX
a) come from the OCX, they are not VFP dialogs, they are dialogs VFP finds in an OCX
b) are not always available as usual properties in VFPs properties window
c) could usually at least be set by code, too, but you'll need OCX documnetation to find out how/where. Even intellisense won't often help you find things, for example in many OCXes, unlike in VFP, where you have fontname/fontsize, etc properties, OCXes have a font object with size fontface etc properties, and so that only shows up in 2nd level of intellisense of the font subobject.

I was goolging the MS Chart chm, I'm pretty sure it once was documented in the MSDN library, like once (last time for VFP6) the chm for VFP was just one part f the MSDN library with help files for very many things related to MS, including VBA for Office, etc., also common controls and some more MS OCXes. I think the chart control is mostly related to Officce and so you may find documentaiton for it in the VBA help system.

Chriss

RE: Chart not displaying correctly on laptop.

(OP)
Further to my previous post I have used the MS Chart properties to add text to my chart.
Surprising behaviour on Notebook compared to Desktop. I have used the smallest available font size
for the text. Note vertical axis numbers and exhibit types printed on Notebook not on Desktop.



GenDev

Adelaide
South Australia

RE: Chart not displaying correctly on laptop.

I would suggest not using the Active X component and instead try using FoxCharts -- it is all VFP code. See https://github.com/VFPX/FoxCharts

Greg

RE: Chart not displaying correctly on laptop.

If something doesn't work after about 10 tries, it's good advice to try something else.

But I just see that the pictures didn't change at all. If you got it right on the PC and that's the basis of your Inno Setup and that's waht you install on the notebook, then still check the version and/or file date of your notebook exe. To me it seems your change doesn't arrive on the notebook, because you miss some very basic step. Something reason like

1. The Inno project doesn't take the EXE from your VFP project folder, where you compile it, so after compiling you need to copy the new exe into an inno project folder
2. You install with the Inno setup on the notebook, but start an EXE fom another install directory that you didn't just upgraded.
3. The inno installer doesn't overwrite the exe, as it alrady exists.
4. Whatever else.

All I know is, once you have a MS Chart ActiveX control on your form, set it up through the properties and/or your code, so if the concrete control on some form is run and displays some chart and you copy just that EXE version with the form with that concretely set up control to another computer also having the MS Chart ActiveX control itself registered, that should look the same, except perhaps sizes differ due to different resolutions. Your charts differ, because once the column labels are visible, on the other not. That's certainly one pf the properties you can set in the control and thse properties are stored within the SCX/VCX in a memo field, they get transported when you build an EXE from the form and get that on another computer, there's no two opinions on that detail. If there's something that turns the column labels/captions on in one case and not the other, it would be in your code, of which yaou have posted nil.

If all that doesn't ring any bell and you find the concrete EXE you start on the notebook has the same version as the one you start on the PC, nobody can help you without hands on your computers, and I'll not go into giving remote help.

Good luck and indeed, when all else fails it's time to use something different.

Chriss

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close