From: Webbiz on
On Fri, 11 Sep 2009 10:27:58 +0100, "Mike Williams"
<Mike(a)WhiskyAndCoke.com> wrote:

>
>"Webbiz" <nospam(a)forme.thanks.com> wrote in message
>news:a13ia51he83d0pasgmt4h7lpbmfq3dmfrm(a)4ax.com...
>
>> It's the chart window and takes up virtually all the
>> space on the form. And the form is usually maximized.
>> And if it is relevant, my display is 22inch flat.
>
>It's the pixel size you are currently running at that matters, rather than
>the actual physical size.
>
>> Anyway, in another post I mention placing .AutoRedraw
>> to False at the point of entry to the routines that are triggered
>> by the button event. It seems to be working okay right now,
>> so I'll keep an eye on any adverse effects.
>
>That's because VB no longer needs to create the Autoredraw bitmap. If your
>app is still functioning correctly then you either did not need Autoredraw
>in the first place or you have altered your code in some way since you first
>actually did need Autoredraw. Perhaps you were originally using Autoredraw
>to maintain a persistent image and you are now instead redrawing your image
>in the container's Paint event.
>
>Even though the act of turning off Autoredraw on your apparently screen size
>PictureBox has solved your immediate problem it is still worth pinning it
>down further though, because unless you are using lots of other large
>Autoredraw bitmaps or are using lots of other GDI objects then you shouldn't
>have a problem with a single screen size bitmap, even on a fairly low spec
>machine. Also, if it turns out that your app currently does have a problem
>creating a single screen size Autoredraw bitmap then your whole app is
>sailing very close to the wind anyway as far as the GDI is concerned and
>solving the current problem by turning off Autoredraw on that single screen
>size object will probably gain you only a temporary solution and the problem
>will surely come back at a later stage. And if you are not using lots of GDI
>resources and if a single screen size bitmap on its own actually does turn
>out to be the cause of the problem (which would indicate that you are
>running on an extremely low spec machine) then you're going to need to take
>that fact into account throughout your entire program when you are
>considering which of the various different ways you should perform your
>required tasks.
>
>Anyway, before you go looking for other esoteric reasons I still think it is
>worth double checking that your code is not inadvertently trying to create
>an extremely large Autoredraw bitmap. What happens when you change your
>existing "With Tbox . . . EndWith" block as follows? What pixel size is
>reported in the MsgBox?
>
>With TBox
> Set FontContainer.Font = .Font
> MaxWidth = .Container.ScaleWidth - .Left
> With FontContainer
> MsgBox .ScaleX(.ScaleWidth, .ScaleMode, vbPixels) _
> & " x " & .ScaleY(.ScaleHeight, .ScaleMode, vbPixels)
> End With
> MinWidth = FontContainer.TextWidth("XX")
> HeightOfLine = FontContainer.TextHeight("X")
> .Height = HeightOfLine
> .Width = MinWidth
>End With
>
>Mike
>
>


The machine is high spec. Tons of memory, gords of hard drive,
saturated with Ghz speed, and plenty of screen space.

Using your code addition, the answer is: 1680 x 952

The problem occurred whether the program ran by itself or I had every
multitasking beast running all over the place, which is what normally
is going on.

At any given time, I may have 4 or more apps running that need the
display. But even when they were all shut down, the problem was still
there.

Now here is something else.

I just ran a copy of the backup (exe) that had also failed when this
all started. Today, it works just fine like it had for years.

And again, I DID REBOOT the computer that night when this started and
it didn't help. So it couldn't be something that was stuck in memory,
etc.

"Space, the final frontier..."

Webbiz


From: Mike Williams on
"Webbiz" <nospam(a)forme.thanks.com> wrote in message
news:h45la5h49dknkpebmjjeqiotr8b2bekjm7(a)4ax.com...

> The machine is high spec. Tons of memory, gords of hard drive,
> saturated with Ghz speed, and plenty of screen space.
> Using your code addition, the answer is: 1680 x 952

You should be able to create at least a hundred or more screen compatible
bitmaps of that size on your machine, and I'm sure in a separate VB app you
certainly would be able to. Are you perhaps creating lots of 1680 x 952
bitmaps in a loop without realising it, an array of PictureBoxes or
something? Or are you doing something else that is perhaps causing your app
to run out of GDI resources long before it runs out of available memory
(perhaps creating thousands of GDI objects of some kind)? Even a very small
GDI object will cause you to run out of resources if you create enough of
them.

Mike




From: Webbiz on
On Fri, 11 Sep 2009 20:02:45 +0100, "Mike Williams"
<Mike(a)WhiskyAndCoke.com> wrote:

>"Webbiz" <nospam(a)forme.thanks.com> wrote in message
>news:h45la5h49dknkpebmjjeqiotr8b2bekjm7(a)4ax.com...
>
>> The machine is high spec. Tons of memory, gords of hard drive,
>> saturated with Ghz speed, and plenty of screen space.
>> Using your code addition, the answer is: 1680 x 952
>
>You should be able to create at least a hundred or more screen compatible
>bitmaps of that size on your machine, and I'm sure in a separate VB app you
>certainly would be able to. Are you perhaps creating lots of 1680 x 952
>bitmaps in a loop without realising it, an array of PictureBoxes or
>something? Or are you doing something else that is perhaps causing your app
>to run out of GDI resources long before it runs out of available memory
>(perhaps creating thousands of GDI objects of some kind)? Even a very small
>GDI object will cause you to run out of resources if you create enough of
>them.
>
>Mike
>

I have no way of knowing the answer to those questions. I don't have
any code that deals with an array of picboxes. There are only two
picboxes in this app.

And since I had rebooted the computer to test if the problem was still
there (and it was), I don't think it was from another app.

But now the problem is gone and I can't duplicate it.

It must have been the September 9th Millenium Virus. ;-b

Webbiz
From: Nobody on
"Webbiz" <nospam(a)forme.thanks.com> wrote in message
news:6o8la55jd5ldhdc2kd0u9qnv1qpisvin9p(a)4ax.com...
> I have no way of knowing the answer to those questions.

Yes you can :-)

Start Task Manager, and in the processes tab, go to View-->Select Columns,
and enable at least "Handle count" and "GDI Objects".

You can also try Process Monitor:

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx


From: Clive Lumb on

"Webbiz" <nospam(a)forme.thanks.com> a �crit dans le message de news:
6o8la55jd5ldhdc2kd0u9qnv1qpisvin9p(a)4ax.com...
> On Fri, 11 Sep 2009 20:02:45 +0100, "Mike Williams"
> <Mike(a)WhiskyAndCoke.com> wrote:
>
>>"Webbiz" <nospam(a)forme.thanks.com> wrote in message
>>news:h45la5h49dknkpebmjjeqiotr8b2bekjm7(a)4ax.com...
>>
>>> The machine is high spec. Tons of memory, gords of hard drive,
>>> saturated with Ghz speed, and plenty of screen space.
>>> Using your code addition, the answer is: 1680 x 952
>>
>>You should be able to create at least a hundred or more screen compatible
>>bitmaps of that size on your machine, and I'm sure in a separate VB app
>>you
>>certainly would be able to. Are you perhaps creating lots of 1680 x 952
>>bitmaps in a loop without realising it, an array of PictureBoxes or
>>something? Or are you doing something else that is perhaps causing your
>>app
>>to run out of GDI resources long before it runs out of available memory
>>(perhaps creating thousands of GDI objects of some kind)? Even a very
>>small
>>GDI object will cause you to run out of resources if you create enough of
>>them.
>>
>>Mike
>>
>
> I have no way of knowing the answer to those questions. I don't have
> any code that deals with an array of picboxes. There are only two
> picboxes in this app.
>
> And since I had rebooted the computer to test if the problem was still
> there (and it was), I don't think it was from another app.
>
> But now the problem is gone and I can't duplicate it.
>
> It must have been the September 9th Millenium Virus. ;-b
>
> Webbiz

Did you take a look at your font as I suggested higher up?


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Permissions again
Next: simple stopwach program