Environment:
I have a JNI program which is made of the following pieces
- C++ : Here I make use of WMI to return the running process details. The program is similar to the example in http://msdn.microsoft.com/en-us/library/aa390423(v=vs.85).aspx
I have encompassed the entire code in the example with a JNI wrapper (One of the parameters I send to the program is of type Integer). Below is the signature of that function
JNIEXPORT jdouble JNICALL Java_handlemonitor_NativeSytem_getSystemDetails(JNIEnv *env, jclass cls, jint pId)
The generated DLL is kept in the bin folder inside JDK directory
- Java : Here I just call the function inside the dll and consume the returned value. I also generate the .h file using the javah program and I have included it in the C++ program.
Issue: When I run the program, I get an error msg in the C++ program that CoInitializeEx failed with the error code 0x80010106.
following is the line where the program fails.
hres = CoInitializeEx(0,COINIT_MULTITHREADED).
I tried increasing the heapSize still it continues to fail.
Any particular reason why CoInitializeEx is failing?
Thanks in advance