This article describes how to host an ActiveX/.NET control in a Java
application that is targeted for the Microsoft Windows Platform. I'll assume
you know the fundamentals of Java, C++, JNI (Java Native Interface), Win32,
COM (Component Object Model), and ATL (Active Template Library).
Because a .NET control can be exposed as a COM component by using the COM
interoperability services provided by the .NET Framework, I'll start by
hosting the ActiveX control. I'll be using the control, the ActiveX control,
and the COM component interchangeably.
The ActiveX Control and Its Container Review
In short, ActiveX controls are COM controls that implement a set of standard
COM interfaces. An ActiveX control is hosted by a container, which must
provide a window to act as the parent for the child control and implement a
set of COM interfaces for communication between the control a... (more)
JTL is a portable C++ JNI template library that allows you to embed a JVM
within another program. An example of this might be found inside a browser
that needs to support Java plug-ins. First I'll discuss the traditional way
to embed a JVM within a native program, and then talk about the generic
solution offered by JTL.
To apply the solution provided by JTL, you need to know the basics of Java,
C++, and JNI. However, to understand JTL's design you should be familiar with
modern C++ techniques, such as template programming and the Boost library
(www.boost.org).
All the sample co... (more)