Re Is this possible

Y2K Bug opus@aracnet.com
Mon Apr 16 19:01:00 GMT 2001


>On 2001年4月16日, Martin, David S wrote: >> 
Now the next step is to create a C++ equivalent of the 
ReportsFrame.java, >> easy right? Well I thought it was until I 
actually tried. >That's not supported, and doesn't work 
(yet). >> gcj -o JavaTest ReportsFrame.o libGenCAM.a 
JavaTest.o >> when I execute the resulting binary I get a core 
dump. >> Any Ideas? >It crashes because the gcj runtime isn't 
initialized.  (If you look at the >output of jvgenmain sometime, 
you'll see it calls JvRunMain instead of >invoking the main class 
directly.  This function does a bit of >housekeeping, such as 
creating the main thread.  It isn't documented, and >is likely to 
change.) >> Is possible to have a c++ class instantiate a java 
class and call methods >> from it? >Yes.  But you cannot 
replace main(). >A c++ class can make callbacks into the java runtime, 
provided there is >a java class somewhere up the call stack.  That 
is, c++ cannot come first. >Jeff
 
Jeff and Others,
 
Ok so I can call the java from a c++ function that gets called 
from a java class via a native call. But how can I remove the second Java layer 
so I can just call the java class from a c++ class??
 
 
 
Dave
 


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /