🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.vcl.components.using.general
7 messages
7 total messages Started by orangecat Sat, 21 Jun 2008 16:59
Weird behavior suddenly started. Help??
#62
Author: orangecat
Date: Sat, 21 Jun 2008 16:59
39 lines
1937 bytes
Hi people,

I have an app (D5ent) that was working fine. I must have changed
something as it now balks at the following...

procedure TfrmMain.FormShow(Sender: TObject);
begin
  LoadPicture;
end;

procedure TfrmMain.LoadPicture;
begin
  if ((dlgPics.SizeIndex = -1) or
      (dlgPics.lbPics.Items.Count = 0)) then
CRASH!!

It seems that the Setup Dialog, "dlgPics" has not yet been created as
I get an "Invalid read address." If I remove the "LoadPicture" from
the OnShow then it works fine when I call LoadPicture with a button.

The damned weird thing is it was working OK and suddenly it is not.
The only thing I can recall doing prior to this behavior was to add

frmMain.Visible:=False;

to prevent a flash of the empty form, until the pic had been loaded
then 

frmMain.Visible:=True;

After that, it now crashes even though I have removed those
statements.

Driving me nuts here.


--

Gary C.
Re: Weird behavior suddenly started. Help??
#63
Author: Remy Lebeau (TeamB)
Date: Sat, 21 Jun 2008 22:44
13 lines
1452 bytes
<orangecat@cableone.net> wrote in message 
news:s6cq549gpc8g9jfe27cgt0n00vqo0l5kic@4ax.com...

> It seems that the Setup Dialog, "dlgPics" has not yet been created as
> I get an "Invalid read address."

That is very likely, if TfrmMain and TdlgPics are both auto-created, and 
TfrmMain is trying todisplay itself immediately (Visible = True) during its 
own creation.  TdlgPics would indeed not exist yet.


Gambit 
Re: Weird behavior suddenly started. Help??
#65
Author: orangecat
Date: Sun, 22 Jun 2008 12:27
20 lines
1637 bytes
On Sat, 21 Jun 2008 15:44:57 -0700, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:

Remy,

I don't think you read my posting fully. I have REMOVED the Visible
code but now it refuses to wrk. This just began happening. It has been
working fine before I ADDED and then REMOVED the Visible code.

Once again you have failed to make a corrective suggestion but rather
point out what I already know.

>>That is very likely, if TfrmMain and TdlgPics are both auto-created, and 
>>TfrmMain is trying todisplay itself immediately (Visible = True) during its 
>>own creation.  TdlgPics would indeed not exist yet.


--

Gary C.
Re: Weird behavior suddenly started. Help??
#66
Author: Q Correll
Date: Sun, 22 Jun 2008 17:22
22 lines
1583 bytes
orangecat,

| I don't think you read my posting fully. I have REMOVED the Visible
| code but now it refuses to wrk. This just began happening. It has been
| working fine before I ADDED and then REMOVED the Visible code.

Why don't you just use a back-up of the code version level prior to
"adding" the changes?
 
| Once again you have failed to make a corrective suggestion but rather
| point out what I already know.

That's a very unkind appearing and unfair remark to make to someone who
is trying to help.


-- 
   Q

06/22/2008 10:19:08

XanaNews Version 1.17.5.7  [Q's Salutation mod]   
Re: Weird behavior suddenly started. Help??
#67
Author: Uwe
Date: Sun, 22 Jun 2008 17:30
6 lines
1376 bytes
> Once again you have failed to make a corrective suggestion but rather
> point out what I already know.

Why do you even ask if you're not interested in suggestions?

Uwe
Re: Weird behavior suddenly started. Help??
#69
Author: Remy Lebeau (TeamB)
Date: Mon, 23 Jun 2008 05:05
14 lines
1641 bytes
<orangecat@cableone.net> wrote in message 
news:h0hs54l5542h703laoe63j8n001eda2hsj@4ax.com...

> I don't think you read my posting fully. I have REMOVED the Visible
> code but now it refuses to wrk. This just began happening. It has been
> working fine before I ADDED and then REMOVED the Visible code.

TForm.Visible is True by default.  If you removed the code to manipulate it 
at run-time, then its design-time value takes effect. If Visible is True at 
design-time, then it could still cause the behavior you describe.


Gambit 
Re: Weird behavior suddenly started. Help??
#73
Author: orangecat
Date: Mon, 23 Jun 2008 16:30
21 lines
1894 bytes
On Sun, 22 Jun 2008 22:05:41 -0700, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:

>>TForm.Visible is True by default.  If you removed the code to manipulate it 
>>at run-time, then its design-time value takes effect. If Visible is True at 
>>design-time, then it could still cause the behavior you describe.

Bingo! Thank you Gambit. That was it. I had not realized that Dephi
reset the value in the Object Inspector. That's why it suddenly
stopped working. I changed the design time back to False and it is all
working again as it should be.

I was getting around the problem with a TTimer and a delay of 1 and in
the OnTimer event LoadPicture and disable Timer.

I learn once again. Thank you for your patience and follow up.


--

Gary C.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads