Exception in C++ dll on calling from JNI
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ramsankar_bose
Posted On:   Monday, May 24, 2004 12:23 AM

I have done a VC++ dll which will call another dll whose functions are to be used ultimately. My VC++ dll will be called by Java through JNI(Java Native Interface). I want to test the VC++ dll by two methods 1. through a C++ exe calling the VC++ dll 2. through a java program calling the VC++ dll. ( actual testing) The first method executes very well in all the cases, while the second is not in some cases. i.e. in VC++ dll , I call an API "Func1(param1,param2, NULL)". This function works fine with C++ exe, but through Java, it is throwing exception. The third parameter of Func1() function is of type " void * ". Third parameter can be NULL, OR some pointer which   More>>


I have done a VC++ dll which will call another dll whose functions are to be used ultimately.
My VC++ dll will be called by Java through JNI(Java Native Interface).
I want to test the VC++ dll by two methods
1. through a C++ exe calling the VC++ dll
2. through a java program calling the VC++ dll. ( actual testing)

The first method executes very well in all the cases, while the second is not in some cases.
i.e. in VC++ dll , I call an API "Func1(param1,param2, NULL)".
This function works fine with C++ exe, but through Java, it is throwing exception.

The third parameter of Func1() function is of type " void * ". Third parameter can be NULL, OR
some pointer which will be having information to validate/do only few operation.
When calling through java , if I make my VC++ dll to have the third parameter of the function
to NULL it throws exception. But while I give some pointer value, it works well (it does what exactly the pointer value means -to do some operations)

But we want to do all the operations. That is possible if we give NULL as third parameter.
But if we give NULL, it throws exception

Could you guess something? Please reply when you are free.



Thanks & Regards,
Ram

   <<Less
About | Sitemap | Contact