Programming by RVA (Random Variable Assignment) instead of actual knowledge and training certainly has its challenges....
I'm pulling a 1.4 meg file out of "Resources" into a richedit control resized to 1600000. Couldn't do it at first, until I guessed that "stack size" would have something to do with limitations. So I increased the stack size for the project to 2097152 and it seems to work just fine. Is that enough for a 1.4 meg RTF string to live and breathe (and respond to @RTFINDTEXT, which it is doing quite well)? Should I be doing something about "commit stack size" as well?
You'll be fine.
Although I would never define a string that size on the stack, instead preferring to allocate them dynamically.
Thanks, Paul. I'll look at dynamic allocation.... Hmm.... I think I'm doing that already.
I'm doing this:
DEF buffer: pointer
buffer = new(char,1600000)
...
CONTROL d1,@RICHEDIT,"",7,350,570,80,0x50B000C4,10
...
CONTROLCMD d1,10,@RTSETLIMITTEXT,1600000
And then use it thus:
flen = LOADRESOURCE(333,324, buffer)
CONTROLCMD d1, 10, @RTLOAD, #<string>buffer, 0
It just now occurred to me -- should I do a DELETE on "buffer"? The only use is to get the resource loaded into the richtext control.
Yes you should be deleting the buffer.
Paul.
Use it, and throw it away, hey? Okay, thanks!