Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of memory error VB6 2

Status
Not open for further replies.
Oct 18, 2001
846
0
0
CA
I have read up on anything I could find on the site and elsewhere regarding this error. I am NOT a database tech, nor do I program unless I have to, and it's very basic when I do.

I have been called in to troubleshoot this error, but I am sure it's the database itself and not the hardware. If anyone can explain this for me, and help me explain what is going on to the client, I will be very grateful.

This occurs locally and over network. Client opens a form in design view, chooses build event and then code builder.
It doesn't happen on ALL forms, just the ones with lots of controls...and the bigger ones.

Any other information you need let me know. The system is Win98SE with Office2K.

Kimber
 
How many controls on the form?

The VB6 documentation states a maximum of 255, but my experience has shown that if you get much over 120 you're asking for trouble.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
It would help if the question had the details of what the error actually said.

Have you got access to a Win NT/2000/XP machine to test on? If it works fine on one of those probable problem is due to "resources" which often get reported as out of memory errors - Win9x had a 64K memory allocation to track system resources such as control window handles etc and this was often limiting - there are various work arounds like using control arrays rather than many single controls and using "handleless" controls wherever possible (e.g. don't use text boxes where a label would do)
 
Thank you for your replies.
chiph
the forms I was looking at I am almost positive there are less than 100 on there.

kainite
It would help if the question had the details of what the error actually said.
The actual error is the title of this thread.
One small box, VB6 in the blue heading. Out of memory.
That's it.

As for your explanation, that is the type of thing I am after, thank you.
I will test the database on the XP Pro machine they have onsite the next time I am out there. If you could provide more "plain" explanations like the text boxes example I would be most appreciative. For example, what is a control array?
Also, if you could explain the difficulty in resource handling, or give me some search terms or a link where I could read up on it, I would be able to prove or disprove my theory that the database design itself needs to be looked at for modification and resolution of the issue.

I am not a database programmer. Some of the jargon gets in the way of my understanding of the problem and negatively affects my ability to explain this to the client.

As far as they are concerned, I should upgrade the ram to solve the problem, and I am sure this is NOT the case.

Again, many thanks for your input both of you.

K
 
I agree with Kainite -- the sooner the Win-9x versions go away, the better. I would test on a WinXP or Win2k box.

Just throwing RAM at it would be my last step.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Update:

Thank you both for your help!

The error was narrowed to the Win98 machines only, and then I was able to meet onsite with the database programmer and give her information on the limitations and explain the problem.
The larger forms with mulitiple sub controls and several drop down list boxes with lookups were the only ones that brought up the error, and there was no error on xp boxes.

No ram upgrade, and I am exhonerated from blame for this one. You put me on the right track to find what I needed to learn...and in turn to explain this to my client.


Thank you for coming through with the information for me!
 
Glad to be of help.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
There is somthing I have yet to see mentioned within these responses so what the heck...

When running the VB IDE to debug MTS COM components, I have seen this error frequently (even with the latest / greatest service packs) and although I can't tell you the exact cause I have found that deleting the registered MTS package for the component and re-creating it fixes the problem.

This may not be what you are experiencing but good to keep in mind none the less.

I have a project which works fine 99.5% of the time, however twice now it has begun giving me this error for no apparent reason... the final resolution is to delete and recreate the Component Package in MTS.

I am developing using VB6/SP6 on Windows 2000 Server (SP4) and using IIS as the testing client while running in debug mode. The hint which made me look at MTS was that I could compile my VB COM Component fine and when not in the IDE (the dll launching via MTS) it worked flawlessly.

Good luck, hope this helped.

Regards,
M Keefer
mkeefer@wifreenet.com
Application Architect / Network Architect / General Good Fellow.
 
My appologies all;

After re-reading (it took some time to complete registration process for this site) I notice the problem has nothing to do with MTS = (

Here is a tip which might be helpful (unless you are doing databound controls)... You can duplicate the functionality of hundreds of text box controls using just one control and moving it around the screen as needed to input locations:

The solution works with VB3,4,5 and should with 6.0 (I have done this many times), the trick is to generate the "look" of text boxes using GDI (draw lines on your form to make the bare form look as if it has text boxes). You can paint the text into them when they are not being edited and build an array of psuedo textboxes (or other controls) and their x/y coordinates. When a user selects one of these psuedo controls, just move the real control there and set the value of the text box so that it reflects the psuedo boxes state.

This technique has been used for years to avoid loading too many resources (even back in Win3.1 16bit) and works well even when plenty of resources are available just to improve loading times and speed of user interface (useability).

If you google some terms like "faking controls VB", "Replacing textbox paint", "reduce resource fake controls" you should be able to find useable sample code to help you out.

Yes the correct fix is usually to get the client to upgrade but, if your talking about hundreds of controls then it's too many no matter what language / os you are using.

One other idea is to move the forms into their own COM Components which take whatever input parameters are needed (like maybe an ADO recordset, or query criteria) then display from their own process space. This will work around the control limitations and breakup your project into useable objects instead of one huge app.

Again hope it helps,
M Keefer
mkeefer@wifreenet.com
 
Thank you for taking the time to respond. I will forward this information to the programmer, and post any feedback here...

Have a great day!



Before you post a question, use the search features of the site to see if your issue was previously addressed in a thread or FAQ.
For the best answers, post as many specific details as possible. Our answers are based on the information provided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top