java calling a cpp dll

From: chris (garcia.91@osu.edu)
Date: Wed Sep 30 1998 - 17:26:57 MEST


	i have built a java executable to try to run the hello world sample, but
it doesn't quite work right.  the program hangs after i get the message "
the current keyboard layout is 437".  i wondered if anyone knows what is
going on???  i know some people have gotten this to work on a unix machine,
is this a windows nt problem??  Or perhaps I have made a dumb mistake
somewhere??  here is the c++ code for the procedure in the dll to call root.

JNIEXPORT void JNICALL
Java_Jhworld_callRoot (JNIEnv, jobject){

extern void InitGui();
VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
 
TROOT root("hello","Hello World", initfuncs);
 

  printf("I am in callRoot \n");
  int * argc= new int;
  *argc=1;
  char** argv=new char*;
  *argv="app";

//  TApplication theApp("App",argc,argv);



//int main(int argc, char **argv)
//{
   TApplication theApp("App", argc, argv);
 
   TCanvas *c = new TCanvas("c", "The Hello Canvas", 400, 400);
 
   TPaveLabel *hello = new TPaveLabel(0.2,0.4,0.8,0.6,"Hello World");
   hello->Draw();
   c->Update();
 
   // Enter event loop, one can now interact with the objects in
   // the canvas. Select "Exit ROOT" from Canvas "File" menu to exit
   // the event loop and execute the next statements.
   theApp.Run(kTRUE);
 
   TLine *l = new TLine(0.1,0.2,0.5,0.9);
   l->Draw();
   c->Update();
 
   // Here we don't return from the eventloop. "Exit ROOT" will quit the app.
   theApp.Run();
 
   return;
}



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:38 MET