Board index » cppbuilder » "Read of Address FFFFFFFF"

"Read of Address FFFFFFFF"

Hi,
  I've been working on this stupid problem for almost a week now, and I
have very little hair left to pull out...
  I thought I had it solved.  Basically, I have two forms, Form1 and
Form2.  Form1, on a keypress, brings up Form2.  Form2 contains a
TListbox.  When the user presses Enter while selecting an item in the
ListBox, it adds the string to a component in Form1, then it calls a
function in Form1, which in turn, closes Form2.  Not too difficult,
really.
  My large app needs this capability, so I built a small test app using
the same components, and it works perfectly.  So I added this to my
large app, used the same identical code to open, close and perform the
actions, and it bombs out with this error message:

 EAccessViolation: Access Violation at address 00515A7B in Module
MyProgram.exe.
Read of Address FFFFFFFF.

I have compared all the Propertiy values and settings, all the project
options between the two programs, and I can find no difference.  I have
done everything that I know how to do, but I keep coming up short.  I
really could use some help here.
Can anyone lend a hand?

Thanks,
Robert

 

Re:"Read of Address FFFFFFFF"


See if deleting the .OBJ and .IL? files will fix it. I get that when I
make a change in design. The IDE seems to remember too much. :-)

Larry
http://www.uncle-larry.com
---------------------------------

Do not e-mail me without a valid return address
-------------------------------------------------//

Re:"Read of Address FFFFFFFF"


Larry,
  Deleted all extranious project files, including those you mentioned,
did a Build All,
and I get the same results.

Robert

Quote
Larry Richards wrote:

> See if deleting the .OBJ and .IL? files will fix it. I get that when I
> make a change in design. The IDE seems to remember too much. :-)

> Larry
> http://www.uncle-larry.com
> ---------------------------------

> Do not e-mail me without a valid return address
> -------------------------------------------------//

Re:"Read of Address FFFFFFFF"


Robert, send the code to borland.public.attachments and I'll look at
it.

Larry
http://www.uncle-larry.com
---------------------------------

Do not e-mail me without a valid return address
-------------------------------------------------//

Re:"Read of Address FFFFFFFF"


Ok, Larry, it's in there..

Good luck and thanks regardless of the outcome,
Robert

Quote
Larry Richards wrote:

> Robert, send the code to borland.public.attachments and I'll look at
> it.

> Larry
> http://www.uncle-larry.com
> ---------------------------------

> Do not e-mail me without a valid return address
> -------------------------------------------------//

Re:"Read of Address FFFFFFFF"


Robert,

With what you sent me, I can't compile. I guess it was a bad idea. I
didn't know you had proprietary functions (components). Sorry.

Larry
http://www.uncle-larry.com
---------------------------------
Do not e-mail me without a valid return address
-------------------------------------------------//

Re:"Read of Address FFFFFFFF"


Larry,
  Yeah, I've been doing this for awhile, and have purchased, what I
consider to be, two of the best component libraries goin', TurboPower's
Async Pro, and the Raize Components.  You can't beat them for quality
and error-free design.
   Anyhow, I'll give this conversation one more try before I re-post.  I
have narrowed it down to a particular "region" of the code, and that is
the lines having to access Form1's SetString() class function.  The
idea, as you can see from the test code, is to simply take the string
from the ListBox (in Form2), and call the Form1 class function
SetString(String InStr) to store the result.  When Form2 closes, we try
to use that string to send to the comport. (or to wherever...)  This is
where the program crashes.  If I eliminate any attempt to access the
Form1 class function from Form2, or, eliminate any effort to access the
ListBox from a function in Form1, the Form2 form closes just fine, no
problems.  I do believe this has a direct bearing on the syntax of this
error, i.e., "EAccessViolation: Access Violation at...".  
  I have, in a further effort, created a global variable instead of a
class function, but this too caused the same problem, so it's not that.
It's an access problem of some kind, caused from trying to access the
Main Form's (Form1) class function from Form2, and visa-versa.  Yet I
can call "KeyListForm->ListBox1->Enabled = false;", without a problem,
in fact, if I don't, trying to close the Form2 from the Form1 function
crashes.
  I figure that there must be some BCB guru out there who knows exactly
what casues this error to appear, but my problem is getting his/her
attention.
  If you don't have any other suggestions, my thanks for trying.  This
has to be one of the toughest problems I've had in the 3 - 4 years I've
been working with BCB, what a mother...

Thanks,
Robert

P.S. - I had no idea you wanted to compile.  That's a lot of code.  The
.exe is 1.6 mB.

Quote
Larry Richards wrote:

> Robert,

> With what you sent me, I can't compile. I guess it was a bad idea. I
> didn't know you had proprietary functions (components). Sorry.

> Larry
> http://www.uncle-larry.com
> ---------------------------------

> Do not e-mail me without a valid return address
> -------------------------------------------------//

Re:"Read of Address FFFFFFFF"


Hi Larry,
  In the FWIW department, I got it...
The exception is caused from trying to access a window or form that does
not have the focus at the point of call.  So I stored the result of the
user's selection in a class variable, and after the window had been
closed, I retrieved this variable.  Then, in a method called OnActivate,
which essentially is an event that gets called when the window regains
focus, I did my printing stuff to this window.  Trying to do this before
this window had regained focus generated the exception.

See 'ya,
Robert

Quote
Larry Richards wrote:

> Robert,

> With what you sent me, I can't compile. I guess it was a bad idea. I
> didn't know you had proprietary functions (components). Sorry.

> Larry
> http://www.uncle-larry.com
> ---------------------------------

> Do not e-mail me without a valid return address
> -------------------------------------------------//

Other Threads