Announcement

Collapse
No announcement yet.

GDI+ on Win98 problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GDI+ on Win98 problem

    I have some GDI+ code that runs fine on Win 2000 and above. Does anyone know of any issues with GDI+ on Win 98, or should I continue to look for an error in my code (or persuade my Win 98 users to upgrade!)?

    I am creating bitmaps for an ImageList by drawing with GDI+ on a memory DC into which the bitmap has been selected. On Win 98SE an apparently random selection of about a third of the images appear; the remainder are solid black with the top left pixel (at 0,0) white. I thought it was a timing issue and put in some SLEEP statements, but that just altered which images appeared OK! On Win 98 first edition none of the images appears correctly.

    Many thanks for any thoughts on this.

  • #2
    SDK speaks:
    GDI+ can be used in all Windows-based applications. GDI+ is new technology that is included in Windows XP and the Windows.NET Server family. It is required as a redistributable for applications that run on the Microsoft Windows NT® 4.0 SP6, Windows 2000, Windows 98, and Windows Millennium Edition (Windows Me) operating systems.
    Then again, there is no longer any support for Win/9x-ME 'anything'

    But if you are looking for "known issues" you might try searching the MS Knowledge Base: that's where all the bug reports end up. Sometimes with a workaround, sometimes not.

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      I can't find anything useful on msdn, apart from a statement that totally contradicts the one MCM quotes above, saying GDI+ doesn't work at all with Win 98.

      Well it clearly does work in the main. I've had no trouble using GDI+ on a screen DC. It's only when writing to memory DCs that there seems to be an intermittent problem under Win98, with the bitmap getting corrupted or not released properly when the DC is deleted.

      Comment


      • #4
        Win/98 GDI is not a 32-bit thing, it's that hybrid 16/32 with some items shared across processes, and some limits on object counts not in the "pure-32-bit" enviroment. Maybe GDI+ forgot about that.

        Then again, your problem could be an error at line 742 of your source code.

        MCM
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Thanks for your input, Michael. I'm fully resigned to the error being in my code (I'm fairly new to GDI+ and couldn't find a GDI+ example using a memory DC to follow).

          But it makes debugging difficult when I can't get it to go wrong on my development machine - only when the EXE is transferred to a couple of elderly Win 98 PCs I keep for the purpose. And with perhaps only 10% of my user base on Win 98, it is far from clear whether it is time well spend chasing a bug that appears only on that platform.

          Plus random errors are something new to me. The same code sometimes works and sometimes doesn't on the same PC with the same data. If I've written bad code, I think the system should have the decency to take exception to it all the time!

          Comment


          • #6
            If I've written bad code, I think the system should have the decency to take exception to it all the time!
            Oh, no, not so!

            Each successive generation of the Widnows operating system has "enforced" the documented rules better and better.

            Sins which were forgiven under Win/98 can result in extreme punishment on Win/XP.

            Of course your problem is the reverse... apparently Win/98 can't handle something Win/XP can handle. Not quite sure what that means except...

            The same code sometimes works and sometimes doesn't on the same PC with the same data.
            That is absolutely a programming error somewhere. You will get that when Windows does one of it's low-priority ("whenever") operations such as closing a disk file or freeing de-allocated memory. Sometimes it gets to it by the time you need it, sometimes it don't. If it don't, your program works. If it do it don't.

            eg pointer: valid? Well, it's not invalid until Windows completes its deallocation. Yes, it's supposed to be invalid if you try to use it when you shouldn't, but when I worked on Win/98 twas not ever thus. Win/XP has been much better about this .. when I make a mistake, it catches me, forgiving and forgetting nothing.



            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment

            Working...
            X