GDIPLUSX - bitmap does not work properly on some Windows 7 installations

Topics: Bug Information
Apr 27, 2010 at 4:32 AM

On some of our client's computers an image control on a form has the infamous X after running the following code (and selecting a picture): (this was first noticed when trying Doug Hennig's gradient class)

DO system.app
LOCAL loBmp as xfcBitmap
WITH _Screen.System.Drawing
    loBmp = .Bitmap.FromFile(GETPICT())
    Thisform.Image1.PictureVal = loBmp.GetPictureVal(.Imaging.ImageFormat.Bmp)
ENDWITH

Note that no errors are generated.
Running the following does result in a 'Class definition XFCOBJECT is not found' error:

DO system.app
LOCAL loBmp as xfcBitmap
LOCAL loStream as xfcMemoryStream
loStream = _Screen.System.IO.MemoryStream.New()
WITH _Screen.System.Drawing
    loBmp = .Bitmap.FromFile(GETPICT())
    loBmp.Save(loStream, .Imaging.ImageFormat.Jpeg)
    Thisform.Image1.PictureVal = loStream.GetBuffer()
ENDWITH

The problem seems to happen only on new Win 7 installs and not on an upgrade from Vista.  However it does not happen on all Win 7 computers - mine, for example, was a new Win 7 installation and I cannot replicate the problem.
Our application is written in VFP SP2 and the newest system.app is present on our clients' computers.  There is no difference in our setup.exe for our clients.

Is there something that could be missing from our Client's Windows 7?

Is there anything else I can try to get it working?

(this is also posted on Issue Tracker)



Jun 1, 2010 at 6:59 PM
This issue has been resolved. The computer used to generate the setup.exe to install our application was running VFP9 with no service packs installed. Installing SP2 fixed the problem.