Message: 4211476 : JTC x DLL
"w w" <[email protected]> Tue, 08 Apr 2003 17:19:56 -0300
| Newsgroups | gmane.comp.lib.jtc |
|---|---|
| Message-ID | <[email protected]> |
<html><div style=3D'background-color:'><DIV>Hi,</DIV>
<DIV>I`m with equal problem: The program crashes after an access violatio=
n.</DIV>
<DIV> </DIV>
<DIV>Do you can help me, sending... complete example ?</DIV>
<DIV>Best regards,</DIV>
<DIV> </DIV>
<DIV>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D</DIV>
<DIV>Hi,</DIV>
<DIV>On Fri, Aug 18, 2000 at 01:50:57PM +0200, Philipp Stadler wrote:<BR>=
> Hi,<BR>> I`m currently writing a small example ( microsoft vc 6.0=
under windows NT )<BR>> using dll in combination with the JTC classes=
and facing a problem: The<BR>> program crashes after an access =
violation. I`ll outline my test suit:<BR>><BR>> #include <JTC/JT=
C.h><BR>> #define DllExport __declspec( dllexport )<BR>><BR>>=
class PH_Thread :<BR>> public JTCThread<BR>> {<B=
R>> public:<BR>> DllExport PH_T=
hread();<BR>> virtual DllExport ~PH_Thread();<BR>>=
; virtual void DllExport run();<BR>> };</DIV>
<DIV>If you do not want to have DllExport defined as __declspec(dllexport=
)<BR>when you build your application, you should only define it when you =
are<BR>building your DLL.</DIV>
<DIV>><BR>> This is the class which I want to include in the dll. I=
n my application I`m<BR>> using it in the following way:<BR>><BR>&g=
t; int main( int argv, char** argc )<BR>> {<BR>> =
try<BR>> {<BR>> JTC=
Initialize bootJTC( argv, argc );<BR>> J=
TCHandleT< MonitorThread > monThr =3D new MonitorThread;<BR>>&nb=
sp; monThr -> start();<BR>> &nbs=
p; }<BR>> catch ( const JTCException & e )<BR>&g=
t; {<BR>> cout <<=
; "Exception: " << e.getMessage() << endl;<BR>>  =
; return EXIT_FAILURE;<BR>> }<BR>&=
gt; return EXIT_SUCCESS;<BR>> }<BR>><BR>> This=
program crashed in the routine JTCThread::init( .... ) and I think the<B=
R>> reason is that the instruction<BR>>!
;<BR>> JTCThreadGroupHandle group_ =3D current=
Thread() -> getThreadGroup();<BR>> // Line =
556 of Thread.cpp<BR>><BR>> returns 0 for the object of the handled=
object. So it crashes a few lines<BR>> later at<BR>><BR>> =
group_ -> add(this);<BR>> because of an ac=
cess violation group_.tg_ is still 0!!!<BR>><BR>> Is it possibel to=
make a dll, like I tried to, at all?<BR>> Have I forgotten something?=
<BR>> Where`s the bug?<BR>><BR>> Thanks for your help in advance=
Philipp</DIV>
<DIV>I tried a small example similar to what you have done here and there=
<BR>does not appear to be a problem. Which compiler flags did you u=
se to<BR>build your application? Were they the same as the ones you=
use to build<BR>the JThreads/C++ library? If they were not, then y=
ou could run into<BR>problems. Please take a look at jtc/README.WIN=
DOWS for details.</DIV>
<DIV>Best regards,</DIV>
<DIV>Brent</DIV>
<DIV>--</DIV></div><br clear=3Dall><hr>MSN Messenger: converse com os seu=
s amigos online. <a href=3D"http://g.msn.com/8HMUBRBR/2749">IInstale gr=E1=
tis. Clique aqui. </a> Get 2 months FREE*. </html>
_______________________________________________
JTC-Users Mailing List - [email protected]
http://www.orbacus.com/mailman/listinfo/jtc-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html