Link to home
Start Free TrialLog in
Avatar of leland_mansuetti
leland_mansuetti

asked on

Run-time error 7

I have written many VB6.0 programs, which I have compiled and installed successfully, on my machine and others. I wanted to change the interface on a particular program,, and when I went to the IDE to make the change and I ran the program (before I made any changes)  I got a Run-time error '7': Out of memory.. The debug always puts me at line of code where I populate a textbox with a variable. The variable can have various lengths, but are not extremely long. In all the development I've done, this is a first time event for me.
Avatar of PaulHews
PaulHews
Flag of Canada image

That's new for me too.  However, the out of memory error is a very common error that often has nothing to do with the amount of memory being consumed.  

First off, reboot, since flaky behaviour sometimes goes away after a reboot.  
Secondly, are there any non-printable ASCII chars in the string?  A lot of controls on the form?  Some background might help.
Avatar of leland_mansuetti
leland_mansuetti

ASKER

The program runs fine when compiled and installed. The problem is isoloated to the IDE. It was only when I went into the IDE to change some colors and locations of an object did the error occur. I then loaded other programs I have written, and without exception, each failed when the program code called for the population of a text box with a string variable. The variables range from one or two sentences t o a complete balance sheet that includes letters. numbers, and variables for a carriage return. Some of these programs are several years old and have, to this point, run just fine in the IDE when I tested them. I have rebotted several times. And, the ASCII characters that I've used have always printed, since they are only letters, numbers, dollars signs, or punctuation. One of the longer strings is 5421 bytes. Yes, there are a lot of controls on the form, but there are on all of the ofher programs as well.

When I click on the text property of each texts box, the name I've given the textbox is followed by two or three flattened circles (maybe machine code). Each time I click on the text property, the number of symbols behind the name increase and appear on the form in the textbox as black squares behind the text box name. I've never seen this before.
These programs (ancillaries for accounting textbooks) have been published and distributed through McGraw-Hill/Irwin Publishing to college and universities and have always passed their techinical analysis.

Sounds like something in your Visual Studio install is corrupted.  Unfortunately the only suggestion I have for that would be to reinstall Visual Basic.
Do you have any add-in installed and loaded? If yes, try to uncheck them and try again
Also check your

tools->options->general tab

don't set on break on all errors, set to break in class module or break on unhandled errors
Check that particular form (program) with another IDE on the other computer (my guess is that that you'll have the same problem). Try re-inserting (deleting and inserting) all textboxes (and possibly all controls on that form) sequentially. At least this is quicker than reinstalling Visual Studio.
Also - have you installed the latest service pack? (just in case you don't):
http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp6/default.aspx

Hi Iv. I downloaded the latest service pack. No help with problem. I'm using SSTabs with 7 tabs. I deleted and replaced the text box on Tab(2) and the error message did not appear. However, I had forgotten to change the multline property from false to true. When I changed the multline property to True, the error returned. I set the multline properties to false on all of the textboxes in every tab and the error no longer occured. But now, of course, the textboxes do not display appropriately.

Does this provide any clues about the problem. If the problem is a corrupted VB6.0, would it still be corrupted after the download of the service pack?
What version of "Microsoft Tab ActiveX control" you are using? (Click "About" of SStab contol in Properties Window). Should be Version 6 (SP6). Could be, that the problem is not
the Tab control, but the textbox itself (try putting some textboxes on a new form and set 'multiline' property of them to 'true').
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial