Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access violation on a form in Windows 2000

Posted on 2003-10-28
13
Medium Priority
?
729 Views
Last Modified: 2010-04-05
I have a problem (only under Win2000, works on NT) where I have a form where the parent property is assigned to a panel of another form and it blows up with an access violation.  This problem does not happen on any other forms done in the same way using the same base create method, any ideas?

Ziggy
0
Comment
Question by:Ziggy500
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9634953
>I have a form where the parent property is assigned to a panel of another form
Why do you need it?
0
 

Author Comment

by:Ziggy500
ID: 9635015
It is needed as the application is based on a framework where we snap in various forms to present information as the user travels around the application.

As I said, it is working in all instances except for one form that causes the access violation...

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9635421
well,
i used this kind of embedded forms also often,
and got never an access violation

could you more specific about the access violation
and when it is raised?

meikl ;-)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Ziggy500
ID: 9635783
The violation is being raised when the child form was being created. It has been narrowed down through process of eliminating controls to a combo control on the form. This control appears on the other forms as well so still not sure what is going on. We thought setting OldCreationOrder to false solved the problem but the problem is back after one successful open.

Ziggy
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9635916
this combo-control is a standard TComboBox or a Thirdparty?
- if standard, how are the items populated or are they static?
- if thirdparty, which?
0
 

Author Comment

by:Ziggy500
ID: 9636020
It is an in house combo, it appears the problem is arising when the combo allows blank items. When I changed the combo boxes on other forms to allow blanks they also blow up. Perhaps in windows 2000 the messaging is not in the order I am expecting and the list is not created when I try to put a blank item in it? If I set allow blanks to false it works fine.

Code:
procedure TLookupListControl.RegisterList(List: TStrings; OnLoadEvent: TNotifyEvent; AllowBlankItem: boolean);
Var I: Integer;
begin
  For I := 0 to RegList.Count-1 do
    if List = TRegItem(RegList.Items[I]).List then break;
 
  if (I = RegList.Count) or (RegList.Count = 0) then begin
    RegList.Add(TRegItem.Create(List, OnLoadEvent, AllowBlankItem));
    end; // if
 
  List.BeginUpdate;
  try
    List.Assign(FList);  // load strings here
 
    // if a blank item is allowed then add it.
    If AllowBlankItem then
      List.InsertObject(0, '', TLPList.Create(Null, False));
  finally
    List.EndUpdate;
    end; // R.P.B.
end; // RegisterList

Zigster
0
 

Author Comment

by:Ziggy500
ID: 9637831
Actual error:

Access violation at address 77F8C7A4 in module 'ntdll.dll'. Write of address 00405201
0
 
LVL 4

Accepted Solution

by:
Colin_Dawson earned 1000 total points
ID: 9645407
How about a quick botch.

    If AllowBlankItem then
      List.InsertObject(0, ' ', TLPList.Create(Null, False));

Put a space in the Item.

The reason that I'm saying this is that the TStrings that is behind the Items, doesn't actually create a place holder for the object when the text for that line is set to ''. - It doesn't do this to save memory.  The same is true for cells on a TStringGrid too!
0
 
LVL 4

Expert Comment

by:Colin_Dawson
ID: 9652347
I'm glad that old chestnut still works.

Thanks for the points.
0
 

Author Comment

by:Ziggy500
ID: 9652506
I was looking in all the wrong places, such a simple solution!

Odd that it only pops its head up on windows 2000 too...

Thanks alot!

0
 

Expert Comment

by:joined
ID: 9874702
You can try EurekaLog (http://www.eurekalog.com).

EurekaLog is an add-in tool that gives to your application (GUI, Console, Web, etc.) the ability to catch every exception (even those raised by memory leaks) and every infinite-loops/deadlock bugs, generating a detailed log of call stack (with unit, class, method and line #), showing and sending it back to you via email.
--
Best regards...

Fabio Dell'Aria.
0
 

Expert Comment

by:simonjeffs
ID: 10282413
Fantastic !!!!

I can believe my luck: I entered "77f8c7a4 ntdll.dll" into google and it displayed this !!!!

I can't believe it is windows 2000 specific.

Solved the problem very quickly and kept customer happy.
0
 
LVL 4

Expert Comment

by:Colin_Dawson
ID: 10292582
hehe, it lucky for you that it is an OS problem.  Otherwise that address would have been about as much use as a chocolate teapot :-)

Colin.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

730 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