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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSPAINT Automation Server Settings - So general fields can be used for reports in W11

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,305
FR
Does anyone know where I can find the registry setting for automating mspaint.exe (from windows 7 or somesuch)
so MAYBE I can run reports in Windows 11 that use general fields for logos etc?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
There is no automation server like word.application or other office applications.

The mechnism of the olebound control is depending on an ole server, too, but it's something different.
You should instead aiming to use the path to an image file in the olebound control.

Just google olebound mspaint and you find recommendations to not use general fields that are 10 years old and older. Much older, because I know it was already recommended to let it go when VFP6 was the latest version.

You would need to look out for the ole class "Paint.Picture", but don't expect you can reinvent olebound image controls by manually using this class. Win10 has this class, but CREATEOBJECT("Paint.Picture") fails with ole error 800040002 - Interface not supported. It's not meant to be used "manually", it's a different interface of OLE automation, a deprecated one VFP does not support via CreateObject, nor NewObject or GetObject, even if it exists on the system. VFP can only use OLE classes that support the IDispatch interface and Paint.Picture obviously does not.

Since about mid 0s you have the ability to use the report olebound control without using its olebound feature, to print images bound by a path to an image file. And especially since VFP9 you have support for even more image file types than with the Paint.Picture. Even though also Paint supports PNG, you can't use ICO based on PNG or use PNG alpha transparency via olebound image. The image control we have for forms is not within report controls, there only is the label, field, line and some shapes plus olebound. All interactive controls are unavailable for simple to understand reasons. But the olebound control also can be used in the same way as the image control for forms. It doesn't have Picture or Pictureval, but look at the properties of an olebound report control, it offers control source types, and a general field is just one of three. The image file name compares to the picture and with the expression or variable name you can specify a table field that has a path to an image file or the expression can be a field that is of type blob containing the whole image file.

So even in case you want the image embedded within the report data which is loaded with a private report datasession, you can. Just use Blob, not General fields. This specific option may not be available in VFP8 or earlier, as the reportengine was extended a lot with VFP9, but as this isn't only available in reportengine 90 mode, IIRC it's available since VFP7, when VFP moved from gdi to gdi+ for its internal graphics/image processing at least by having a field with filename.

As far as I read about the Win11 problem, it's deeper than just the general field problem, there's a catch with the whole report engine to be fixed. I don't know a solution to that, but at least for Win10 you can still change to any of the two other control source types of olebound report controls to finally get rid of using olebound for images. I'll go on the limb and say the olebound report control has deprecated to be used as that, the use for images was already the worst use of it anyway, responsible use of the olebound feature is for RTF or Graphs or other "Ole thingys" that are really needing OLE, but not images. Images always had the far easier usages though files. And many ole controls in principle usable in VFP have interactivity that disqualify them for reports.

Chriss
 
Hi Chris

I was hoping for a quick workaround to get past this PITA, I'm not looking forward to modifying, maybe, hundreds of reports and many, many forms...

So far I have two clients with W11 machines - both of whom have taken them back to W10 - one of them despite being told 'it won't work on W11' BEFORE
they installed it anyway!

I think you are right, I'll just have to find a machine to install W11 on to test it.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
I *may* have found a solution, from a series of posts on an M$ site:
It *seems* that all that may be needed is a series of registry keys.

I have attached a zip (untested as yet).

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top