Native method names
843829Jan 21 2004 — edited Jan 26 2004I am new to JNi but have been through the tutorial and read many many threads in the forum.
I want to create a native method in my class (ShellExec.class) to initiate the ShellExecute function provided by microsoft in shell32.dll. I have created a native method called shellExecute which generates the method name "Java_ShellExec_shellExecute" in the header file (.h file). However, the native function is called "ShellExecute", so when I run my class I get an UnsatisfiedLinkError as the names don't match. javah always appends Java_classname_ to the method name.
Do I need to write a C or VB program with a function name of "Java_ShellExec_shellExecute" that in turn calls the ShellExecute function or is there some way of getting my method name to match the function name?