BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Synchronize in Thread causes an exception

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Detlef
Guest





PostPosted: Wed Jan 21, 2004 11:55 am    Post subject: Synchronize in Thread causes an exception Reply with 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





PostPosted: Wed Jan 21, 2004 12:45 pm    Post subject: Re: Synchronize in Thread causes an exception Reply with quote



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





PostPosted: Wed Jan 21, 2004 3:37 pm    Post subject: Re: Synchronize in Thread causes an exception Reply with quote



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





PostPosted: Wed Jan 21, 2004 7:07 pm    Post subject: Re: Synchronize in Thread causes an exception Reply with quote


"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





PostPosted: Thu Jan 22, 2004 8:11 am    Post subject: Re: Synchronize in Thread causes an exception Reply with quote

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





PostPosted: Thu Jan 22, 2004 8:01 pm    Post subject: Re: Synchronize in Thread causes an exception Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.