Solved

A Win32 API function failed

Posted on 1999-01-21
7
2,115 Views
Last Modified: 2012-08-14
Help! I use Delphi 3 enterprise edition. I have an app that can not be run from the IDE. It has to do with memory. The IDE leaks like a sieve after running for a while. I get the error sometimes when I'm trying to alter a graph object. Sometimes the system will get so low on resources that it will lock up my system and I have to hard boot my system. My question is this: Is there a way to increase the memory the IDE allocates for running apps? Has anyone run into this problem? How did you fix this?
0
Comment
Question by:evansj
  • 3
  • 3
7 Comments
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
Are you sure it is the IDE, and not your own code that is leaking?

Cheers,

Raymond.
0
 

Author Comment

by:evansj
Comment Utility
Oh, BTW, the app is a database app running under BDE 5.0.
It runs on a P2-300MHZ machine w/64Meg of RAM. I run the BDE off a Novell Network (Netware 4+). I also run VShield, Office Bar, and tape scheduler. So I have removed every thing from memory I could, closed everything I could, and I still get the error when opening certain forms.
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
Comment Utility
OK - some more comments (actually I'll make it an answer...):

You say it is getting low on resources - do you mean resources like window handles? This is a separate issue from low memory. To minimise the amount of resources your app uses here are some tips:

1. Don't autocreate all your forms. Create a form when it is required and destroy it (either by setting Action := caFree in the OnClose or using MyForm.Release).

2. Don't create lots of bitmaps. These suck up handles quickly. See if you can use a TImageList to manage large numbers of same sized and colour depth bitmaps.

3. Make sure you don't hold on to resources such as bitmaps, fonts, brushes etc after you have finished using them.

Delphi doesn't allocate any amount of memory to an app to run in. This is what the OS does. The app is quite free to use all the virtual memory available to the system.

Cheers,

Raymond.

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:evansj
Comment Utility
I have considered this but I have opened the IDE with another delphi app already open and had it go boom without even attempting to run the app. We have several Delphi apps. Depending on which one is open, the IDE sometimes won't open with the app. I have the IDE set up to open with the last app worked. Also, this may be a Win95 thing, but I have opened the IDE and checked the resources. Worked in the IDE and rechecked the resources. Serious use of the resources, typically 3-6% resources left after being in the IDE a while.
0
 

Author Comment

by:evansj
Comment Utility
I'm sorry Delphi.
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
The IDE itself is going to need to use resources. If there are not enough available then it won't run.

NT is a completely different story as its resource limitations are much, much higher than Win95's and is a much better platform to do the development on...

Cheers,

Raymond.
0
 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
Bought This Question.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now