On 25 Jul 2003 05:11:42 -0700,
(Cengiz) wrote:
> Hi,
> what i do in my program:
> I have a class in Java. Some Methods of this class call another global
> native-method written in c++ (in a DLL). This method in c++ instances
> a class. How can i do it, that at the next invocation i can use the
> same instance without instantiate it new ?
Including Pete's approach (which I have used myself on
several ocassions), you can set a static field in the
C++ class and just retrieve it on entry to get the
instance pointer. Or set a DLL global variable.
In all of these instances, be sure you take thread
safety into consideration.
--Joe