Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
- From: "Michael C" <mculley@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 Jan 2006 09:55:13 +1100
"Steve Richfie1d" <Steve@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43681rF1lserdU1@xxxxxxxxxxxxxxxxx
> Bob,
>
> There seems to be a basic (no pun intended) disconnect here:
I'd have to agree with Bob here (not necessarily on his delivery though :-),
the textbox was reliable in it's acceptance of exactly 32k of text. Can you
use this code to add the text and see if you still get the error:
Private Sub AddText(ByVal TB As TextBox, Text As String)
On Error GoTo Fail
Dim s As String
1 s = TB.Text
2 s = s & Text & vbCrLf
3 While Len(s) > 32768
4 s = Mid$(s, 10000)
Wend
5 TB.Text = s
Exit Sub
Fail:
MsgBox Erl & " " & Len(TB.Text) & " " & Len(Text) & " " & Len(s)
End Sub
>
>> I could fire up VB5 and build a trivial test app to pad a textbox out to
>> those exact numbers and then concatenates that many more, but I already
>> know *exactly* what would happen.
>
> So do I - it would almost certainly work great and as described in the
> literature. However, on a breakpoint I hovered over Len(txtLog) and it
> gave me the length, then I hovered over what was being concatenated and
> counted the characters on the screen, then F8'ed the simple statement to
> concatenate the two strings and got the error I posted. Hence, it *IS*
> real.
>
> OBVIOUSLY SOMETHING is happening here that at least some of the time
> fails. Further, when I changed the logic to chop at 20K instead of 30K the
> problems went away. I'm just wondering if the problem REALLY went away, or
> just stopped crashing in present testing only to cause problems after we
> start shipping. Things like this could give you nightmares when you don't
> understand WHY they failed - which is my present situation.
>
>> When you see something happening which you think should be impossible,
>> don't conclude that the impossible is happening.
>
> Why not - I see the impossible at least weekly! Just read some of my prior
> postings here - others have been pretty successful at identifying the
> obviously impossible things that I have been running into. There is a LOT
> in VB that doesn't work as advertised, or as you would think is
> reasonable. Some things even work differently in the IDE than they do in
> EXEs!
>
> BTW, this application is VERY unusual, with 4 different real-time AcitveX
> controls coordinating speech synthesis and recognition in real time
> conversations. With all this going on, damn near anything is possible! I
> am apparently pushing VB *WAY* beyond where it was ever intended to go,
> e.g. I must continue servicing events while in my error handler to be able
> to debug this program!
>
>> It's SO much more
>> likely that you're missing something that really *is* happening.
>
> Nope! Again, just read some of my prior postings here. Most are obviously
> impossible, but VERY real.
>
>> Therefore, describing the impossible to the newsgroup and asking for a
>> solution is mostly just a waste of everyone's time.
>
> It certainly hasn't been a waste of MY time, as Michael and Tony have dug
> down to exactly WHY some of my impossible happenings have happened.
>
>> Post [minimal] code which demonstrates the problem.
>
> Hey, I used to work supercomputer compiler support at CDC. When dealing
> with someone who might actually FIX a problem (no chance with VB5),
> minimal code is important. Unfortunately, there is no central public bug
> repository to check before diving into such efforts to avoid wasting time.
>
> Many real-world problems just don't reduce to minimal code, ESPECIALLY
> where something is blowing memory, stacks, etc., which is SO common in
> Microsoft's crappy C coded systems.
>
> My favorite such bug at CDC was a benchmark that ran instantaneously. The
> customer looked at the code that the compiler produced, and there was the
> outer DO loop (it was coded in FORTRAN) structure but the 10 pages of
> complex code within the DO loop had evaporated! Some debugging showed what
> the problem was - they didn't output or return any of what they were
> computing, so the compiler statement-by-statement had worked its way
> backwards through the program deciding that each statement was extraneous.
> I reported back why the compiler was working OK and if they just wanted to
> waste time (benchmark) that they needed to output something for their
> efforts, and submitted an internal low-priority bug report that empty DO
> loops weren't being eliminated!
>
> BTW, remember when the ANSI C standard was held up for a year? That was
> myself and 2 other guys trying to get critical bugs fixed in the
> specification. They were never fixed, and now are in part responsible for
> the general unreliability of present C coded systems, including the
> security holes that Microsoft keeps patching. Who knows, the loss of that
> political battle years ago could underlie this very problem!
>
>> Most of the time - while you're in the process of isolating just enough
>> to make it reasonable to bring it here and post - you'll FIND what's
>> really happening,
>
> I did that by breakpointing and checking absolutely everything involved in
> the simple concatenation statement that failed.
>
>> and you'll see how to fix it. If you did that first, you wouldn't even
>> have to ask the question.
>
> Again, WRONG! This program definitely does NOT live in the simplistic
> world that you clearly envision.
>
> My recommendation: Hold your objections while Michael or Tony or ??? have
> a crack at this.
>
> Steve Richfie1d
.
- Follow-Ups:
- References:
- Text box throws an Error 7 Out of Memory with less than 27K in it!
- From: Steve Richfie1d
- Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
- From: Bob O`Bob
- Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
- From: Steve Richfie1d
- Text box throws an Error 7 Out of Memory with less than 27K in it!
- Prev by Date: Re: VB inputbox ? How to check if user clicked OK or Cancel ?
- Next by Date: database crashes
- Previous by thread: Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
- Next by thread: Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
- Index(es):
Relevant Pages
|