Solved

FREE TCOMPONENTLIST

Posted on 2002-06-15
4
334 Views
Last Modified: 2010-08-05
FREE TCOMPONENTLIST

When I try to free TComponentList I get this error :

ACCESS VIOLATION,

and every time (after free method) when I try to use TComponentList named ComponentList.

How to solve this problem ?

Thanks.
0
Comment
Question by:ghjlk
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7080501
you should show how you free and access your list
0
 

Author Comment

by:ghjlk
ID: 7080565
//first oncreate event
componentlist.create;

//then two methods of create components
componentlist.add &
componentlist.insert

//in componentlist I put Forms, ActiveX components and others.


//section new
while componentlist.count>0 do
TControl(componentlist[0]).Free;

componentlist.free;
componentlist.create;

Thanks.
0
 

Author Comment

by:ghjlk
ID: 7080667
Sorry :
componentlist:=TComponentlist.create;
0
 
LVL 7

Accepted Solution

by:
Cynna earned 250 total points
ID: 7080733
ghjlk,

Try creating componentlist like this:
 
  componentlist:=TComponentlist.Create(FALSE);

This will ensure that componentlist.free doesn't try to free components that you already freed before.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

15 Experts available now in Live!

Get 1:1 Help Now