| View previous topic :: View next topic |
| Author |
Message |
Detlef Guest
|
Posted: Wed Jan 21, 2004 11:55 am Post subject: Synchronize in Thread causes an exception |
|
|
Hi all,
I call in my thread class a member function via Synchronize, because this
function should display on the main form. At the Synchronize command it
cause the exception "access violation at address 0xx4002B283 ( this in the
rtl60.@Classes@TList@Add$qqrpv) reading of addess 00000008.
This occurs since I derived my class from another class.
explaination:
class A: public TThread
{
};
class B: public A
{
};
Now I'm using class B for the future, because it depend's on the project.
And class A is in a dll.
I'm looking for some program faults, but if somebody knows about the same
problems?
Detlef
|
|
| Back to top |
|
 |
Detlef Guest
|
Posted: Wed Jan 21, 2004 12:45 pm Post subject: Re: Synchronize in Thread causes an exception |
|
|
Some additional informations:
If I go with the debugger thru the code and try to inspect the function
Synchronize, it says: Error E2027: a memory address must be used.
It works with other functions there.
Detlef
"Detlef" <detlef.stute (AT) seatec-gmbh (DOT) com> schrieb im Newsbeitrag
news:400e68b4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi all,
I call in my thread class a member function via Synchronize, because this
function should display on the main form. At the Synchronize command it
cause the exception "access violation at address 0xx4002B283 ( this in the
rtl60.@Classes@TList@Add$qqrpv) reading of addess 00000008.
This occurs since I derived my class from another class.
explaination:
class A: public TThread
{
};
class B: public A
{
};
Now I'm using class B for the future, because it depend's on the project.
And class A is in a dll.
I'm looking for some program faults, but if somebody knows about the same
problems?
Detlef
|
|
|
| Back to top |
|
 |
Detlef Guest
|
Posted: Wed Jan 21, 2004 3:37 pm Post subject: Re: Synchronize in Thread causes an exception |
|
|
After some test I find out:
1. the problem only occurs, when the parent class is located in a dll.
2. the problem is that an internal object of the TThread.Synchronize method
( SyncList) is not iniatialised.
The question is now: Is it allowed to use a thread object derived from
another base class?
Detlef
"Detlef" <detlef.stute (AT) seatec-gmbh (DOT) com> schrieb im Newsbeitrag
news:400e68b4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi all,
I call in my thread class a member function via Synchronize, because this
function should display on the main form. At the Synchronize command it
cause the exception "access violation at address 0xx4002B283 ( this in the
rtl60.@Classes@TList@Add$qqrpv) reading of addess 00000008.
This occurs since I derived my class from another class.
explaination:
class A: public TThread
{
};
class B: public A
{
};
Now I'm using class B for the future, because it depend's on the project.
And class A is in a dll.
I'm looking for some program faults, but if somebody knows about the same
problems?
Detlef
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Jan 21, 2004 7:07 pm Post subject: Re: Synchronize in Thread causes an exception |
|
|
"Detlef" <detlef.stute (AT) seatec-gmbh (DOT) com> wrote
| Quote: | The question is now: Is it allowed to use a thread object
derived from another base class?
|
Yes. But that is not the cause of your problem. The real cause is because
a DLL is involved. Try using a Package instead.
Gambit
|
|
| Back to top |
|
 |
Detlef Guest
|
Posted: Thu Jan 22, 2004 8:11 am Post subject: Re: Synchronize in Thread causes an exception |
|
|
Hi Gambit,
sometime a new day helps more than hours of thinking before.
If I compile my dll with "Use RunTime packages" enabled it works, if I
disable that is raises the exception.
Is the reason that with the run time packages this run time system will be
used for all Borland compiled applications ( incl. dlls)? And therefor these
apps will use the same instance of the VCL?
Detlef
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> schrieb im
Newsbeitrag news:400ecc4b$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Detlef" <detlef.stute (AT) seatec-gmbh (DOT) com> wrote in message
news:400e9cb4$1 (AT) newsgroups (DOT) borland.com...
The question is now: Is it allowed to use a thread object
derived from another base class?
Yes. But that is not the cause of your problem. The real cause is
because
a DLL is involved. Try using a Package instead.
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Jan 22, 2004 8:01 pm Post subject: Re: Synchronize in Thread causes an exception |
|
|
"Detlef" <detlef.stute (AT) seatec-gmbh (DOT) com> wrote
| Quote: | If I compile my dll with "Use RunTime packages" enabled
it works, if I disable that is raises the exception.
Is the reason that with the run time packages this run time
system will be used for all Borland compiled applications
( incl. dlls)? And therefor these apps will use the same instance
of the VCL?
|
Yes.
Gambit
|
|
| Back to top |
|
 |
|