delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/19/11:51:42

From: root AT jacob DOT remcomp DOT fr (root)
Subject: Re: B19 dll with JNI causing Dr. Watson to drop by...
19 Oct 1998 11:51:42 -0700 :
Message-ID: <m0zV73B-0002i9C.cygnus.gnu-win32@jacob.remcomp.fr>
References: <Pine DOT SUN DOT 3 DOT 96 DOT 981018233313 DOT 504D-100000 AT theory>
To: kiyoko AT iis DOT sinica DOT edu DOT tw (Kiyoko F. Aoki)
Cc: gnu-win32 AT cygnus DOT com

> 
> I am using g++ version egcs-2.91.57 (1.1 release) on NT4 (SP3) to create a
> dll that is called from my Java program through JNI.  My problem is that
> my Java app can call the C++ routine ok, but Dr. Watson pops up in the
> following cases:
> 
> 1. Initializing anything with new or malloc
> 2. Calling another c++ routine that allocates any memory as in above
> 
You should initialize your run time when your library is loaded, and clean-up
when it is unloaded.
In your LibMain procedure, you should treat the case
	DLL_PROCESS_ATTACH:
and call the specific run time initialization there.
In the same way, you should handle:
	DLL_PROCESS_DETTACH:
and call the runtime cleanup routines.

This is just basic win32 programming. Read any documentation about dlls and
you will find this.

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019