Skip to Main Content

AttachCurrentThread not setting 'env' parameter

573044May 4 2011 — edited May 4 2011
Here are a bunch of snippets of my code (written in Pascal). I tried to grab all of the important parts - let me know if I missed anything.
//type declarations
PJavaVM  = ^JavaVM; 
PJNIEnv = ^JNIEnv;
...
//global variable
var
  MainJVM : JavaType.PJavaVM;
...
// Setting the 'MainJVM' variable (from the main thread) within a procedure
var
  env : JavaType.PJNIEnv
...
env^^.GetJavaVM(env,MainJVM);
...
// Attaching MainJVM's thread to 'env' (which isn't working) within a procedure
var
  env : JavaType.PJNIEnv;
...
MainJVM^^.AttachCurrentThread(MainJVM,@env,nil)
Everything seems to be working up to the 'AttachCurrentThread' line. That line returns a 0 but the value of 'env' isn't updated.

Thanks!
Comments
Post Details
Added on May 4 2011
2 comments
185 views