Solved

A Win32 API function failed

Posted on 1999-01-21
7
2,187 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
ID: 1362748
Are you sure it is the IDE, and not your own code that is leaking?

Cheers,

Raymond.
0
 

Author Comment

by:evansj
ID: 1362749
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
ID: 1362750
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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:evansj
ID: 1362751
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
ID: 1362752
I'm sorry Delphi.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362753
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
ID: 1362754
Bought This Question.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 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