How do i include a native method declaration dynamically in a java class?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pratibha_Girish
Posted On:   Saturday, June 8, 2002 03:17 AM

I get the name of a native method dynamically(at run time). I also get the name of the dll file that has to be loaded. In my java program which is a generic one for invoking many such native methods, how do i declare the native method. For eg. There are two native methods, print and getTotal. print can be invoked by loading the file HelloWorld.dll and getTotal can be invoked by loading the file Calculate.dll. At runtime the user selects which of these methods to invoke. Also the user specifies the dll file to be used. Both the dll files are in the path and are accessible to the generic java class that will be calling these methods. As a requirement for invoking native methods from a java class a declaration of the method has to be pres   More>>

I get the name of a native method dynamically(at run time). I also get the name of the dll file that has to be loaded. In my java program which is a generic one for invoking many such native methods, how do i declare the native method.
For eg.


There are two native methods, print and getTotal. print can be invoked by loading the file HelloWorld.dll and getTotal can be invoked by loading the file Calculate.dll. At runtime the user selects which of these methods to invoke. Also the user specifies the dll file to be used. Both the dll files are in the path and are accessible to the generic java class that will be calling these methods. As a requirement for invoking native methods from a java class a declaration of the method has to be present in the java class. Since at the time of writing the class i do not know the method names please let me know how to include this declaration dynamically.



TIA, Pratibha.    <<Less
About | Sitemap | Contact