KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com4j > Native


1 package com4j;
2
3
4
5
6 /**
7  * Native methods implemented in the dll.
8  *
9  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
10  */

11 class Native {
12
13     /**
14      * Initializes the native code.
15      */

16     static native void init();
17
18     /**
19      * Creates a COM object and returns its pointer.
20      */

21     static native int createInstance( String JavaDoc clsid, long iid1, long iid2 );
22
23     /**
24      * Calls <tt>AddRef</tt>.
25      */

26     static native void addRef( int pComObject );
27
28     /**
29      * Calls <tt>Release</tt>.
30      */

31     static native void release( int pComObject );
32
33     /**
34      * Invokes a method.
35      */

36     static native<RetT> RetT invoke( int pComObject, int vtIndex,
37          Object JavaDoc[] args, int[] parameterConversions,
38          Class JavaDoc<RetT> returnType, int returnIndex, boolean returnIsInOut, int returnConversion );
39
40     static native int queryInterface( int pComObject, long iid1, long iid2 );
41
42     /**
43      * Loads a type library from a given file, wraps it, and returns its IUnknown.
44      */

45     static native int loadTypeLibrary(String JavaDoc name);
46
47     /**
48      * Calls "CoInitialize"
49      */

50     static native void coInitialize();
51     /**
52      * Calls "CoUninitialize"
53      */

54     static native void coUninitialize();
55 }
56
Popular Tags