How to get around problem that you can't pass env between threads?

I get all the typical parameters in a JNI method call, but I need to display callback messages using these parameters from another thread. The main problem is saving the JNIEnv pointer for future use. How do you do that?
EX: - my C program that is turned into a dll:
static JNIEnv *m_env;
static jobject m_jobj;
first_method(JNIEnv* env, jobject jobj, ...) {
// I want to save the env and jobj globally
// so it can be used in callback
m_env = env;
m_jobj = env->NewGlobalRef(jobj);
// start the thread that generates callbacks
// callback method - called by another thread
second_method(...) {
// use the global variables to call a Java method
jclass clazz = m_env->GetObjectClass(m_jobj);
jmethodID mid = m_env->GetMethodID(clazz, ...);
jstring msg = m_env->NewStringUTF("A message");
m_env->CallVoidMethod(m_jobj, mid, msg);

You have to register each thread (there is a method.) Then there is another method (or maybe the same one) that returns the env for the thread.

Similar Messages

  • How do get your applications that you create in x code to you iphone

    How do you get your applications that you create in x code to your iphone so it can be tested?

    Use the resources you paid for in the iOS Dev Center...
    Xcode Overview
         Run Your App

  • I have sent you a question and all I get back is that you can't activate my account. I have clicked on the link you provided and entered the correct address. What else can I do to get help. How about a phone number?

    ''locking - please continue in your original support thread - here - https://support.mozilla.com/en-US/questions/835625''
    I sent you a question yesterday and you sent me an email saying you couldn't activate my account because I either didn't click on the right link or enter the correct address. I have done both of these correctly but nothing changes. What can I do to get my original question answered - talk to someone?

    When you say "account," do you mean your iTunes library, because your iTunes library is what is on your computer?  Your iTunes library does not have an email address.  An account that is related to iTunes is your Apple ID (which is an email address) and you use it as your user name to sign in to the iTunes Store, to make purchases.  Changing your Apple ID will not make songs disappear from your computer's iTunes library.
    If you had an Apple ID and used it to make song purchases from the iTunes Store, and then started using a different Apple ID, you should be able to re-download the songs purchased with the old Apple ID.  In iTunes, sign in to the iTunes Store using your OLD Apple ID (and password).  That may not be your current email address, but Apple uses it as your user name, so it does not matter.
    On the iTunes Store Home screen, click on Purchased under QUICK LINKS.  This takes you do the Purchased screen, where you can re-download previous song purchases (for that Apple ID) at no cost. 
    NOTE:  If those song purchases are from more than a few years ago, you may also need to authorize your computer to play (and sync) songs for your old Apple ID. 
    For songs that were not purchased from the iTunes Store, if they are also gone, you cannot get them back unless you have a backup (or they are still loaded on your old iPod).
    If that's not what you mean by "changed the email address on my account," please post back with more details.

  • How to edit pdf so that you can save entered information in Reader?

    I have Acrobat Professional 8 at home as part of Adobe CS3 but we only have acrobat reader at work.
    My supervisor has an evaluation form that is setup in pdf format and has fillable information boxes such as name, job description, etc. However, you can not save the information you enter into the document. I need to know how I can alter the pdf in Pro 8 so that the information can be saved with just reader.
    This is probably a simple one to those who use these programs a lot, but unfortunately I don't so I am kind of behind the learning curve here.
    Any help????

    When you are talking a business form, the application may be different than the original post. I would suggest you read part 15 of the AA9 EULA (license agreement) that is available from adobe.com. This is where the 500 use limit might apply.
    Before you purchace AA9 for the feature, it would be wise to be sure your application would be in line with the EULA, or you will be real ticked at buying AA9 for the feature and then not being able to use it legally. You may want to indicate why you want folks to be able to save the form. If it will not be submitted, then I think you will be fine with AA9.
    If it is for submission, then you may have a problem with the 500 use limit. However, saving is not needed to submit the data! The data can simply be imported to the PDF and so you don't need it in that form.

  • How to get games back that you put on iCloud on new iPhone. So you do not have to start over.

    We can from sprint to Version. Is there a way to get all the games that you backup on Icloud so you do not have to start over. Tiny castle, Puzzle and Dragon, tiny zoo, and tiny monster.

    Back up and restore the device
    http://support.apple.com/kb/HT1766?viewlocale=en_US

  • I'm trying to add the email address for my verizon phone to iMessaging.  In order to verify, you have to reply to an imbedded link in the message.  Unfortunately the link is truncated.  Any idea how to get around this?

    I'm trying to add the email address for my verizon phone to iMessaging.  In order to verify, you have to reply to an imbedded link in the message.  Unfortunately the link is truncated.  Any idea how to get around this?

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (122986)

  • How do I solve problem that safari cannot open because of too many redirects?

    How do I fix problem that safari can't open because of too many redirects?

    Try clearing the browser cache and delete any cookies for that site. If that doesn't resolve it, then that's a problem with the web-site itself, so unless it is your own website, you can't fix it.
    Often it's a bug in the website code that detects what device/browser you are using and it gets stuck in a re-direct loop. You could contact the website developers and inform them.

  • I accepted/installed an update for iMovie and it turns out that this version is not compatible with my graphics card. So now I can no longer open or use iMovie.  Any ideas on how to get around this - how to revert to the previous version.

    I accepted/installed an update for iMovie and it turns out that this version is not compatible with my graphics card. So now I can no longer open or use iMovie.  Any ideas on how to get around this - how to revert to the previous version??

    Look in your Applications folder.  If your system behaved as expected, you should have an iMovie 9.0 folder in your Applications folder.  Apple moved the old version there as even they suspected the new versions was a train wreck.

  • When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    mostafa182 wrote:
    ... how I can solve this problem?
    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • How can i buy songs off itunes that you can't get on the Canadian version but you can in the u.k. version

    How can i buy songs off itunes that you can't get on the Canadian version but you can in the u.k. version
    I would really like to get these songs (not illegally like most people) because i really like them but they are only in the U.K. or Irish version of iTunes and I'm on the Canadian version
    If anyone can tell me how i could possibly get these that would be great thanks

    OS X is the same no matter where you buy it.  You can switch it to Japanese or one of 30 other languages in few seconds via the system preferences.
    If you want a Japanese keyboard as well, you can select that when you configure your purchase:
    http://store.apple.com/us/configure/MD093LL/A?

  • How to install when I keep getting the following massage  on windows 7 64 bit with or with firewall on and vwith or with virus protection on  here is post  This installation package could net be opened verify that the package exist and that you can access

    how to install when I keep getting the following massage  on windows 7 64 bit with or with firewall on and with or with virus protection on  here is post           " This installation package could net be opened verify that the package exist and that you can access"  same when trying to install quicktime

    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/quicktime/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • HT204053 When i try to sign in iCloud from my pc, i get a error message telling that "you can't sign in because of a server error". Why is it so? what is the problem?

    When i try to sign in iCloud from my pc, i get a error message telling that "you can't sign in because of a server error". Why is it so? what is the problem?

    Hi spillgar,
    If you are having issues signing in to iCloud from your Windows machine, you may find the following articles helpful:
    iCloud: Account troubleshooting
    http://support.apple.com/kb/ts3988
    iCloud: If you can’t sign in to iCloud.com
    http://support.apple.com/kb/ph2611
    Regards,
    - Brenden

  • My downloads of iTunes and related software onto my Windows PC fails every time with error message that the software does not have valid signature.  How to get around this problem?

    I have trouble downloading iTunes software and related software like the new ios8 on both my desktop--Windows 7, and my laptop--Windows Vista, because I keep getting error messages saying the software has been deleted because invalid signature.   I have tried download and install and I have tried just download, but neither method works.   So I am stuck with the older software and my new iPad 2 Air isn't connecting because I need ios8 apparently.
    I have an iPhone 5 and a new iPad 2 Air.
    How to get around the Windows problem, please?
    Thank you!

    bump

  • When i go to the icloud page and click find my phone, i get a box that says "can't load find my iphone.  There was a problem loading the application".  What do I do now?  Thank you

    When i go to the Icloud page and i click on find my Iphone, I get a message that says "Can't load Find my Iphone. There was a problem loading the application." What do I do now.  Thank you

    Mail has been down all morning. Pacific time. California here.
    Since 7am PST - it's 11:36 am right now. still down.
    It's a routine maintenance issue I was told. - but very frustrating not to know ahead of time.

  • How do you add non-Garage band instruments into a Logic project so that you can hear them on playback?

    How do you add non-Garage band instruments (orchestral instruments) into a Logic Pro (8) project so that you can hear those insrtruments' sounds on playback?  I've tried to understand and follow the Logic Pro 8 User Manual, but the process comes off as so complex and the writing so technical that it does not help but only confuses.
    To be precise - I want to add instruments (orchestral) that are not offered in the current Garage band menu which is offered in the Mixer's channel strip menus for Logic Pro 8.  To be clear, the instruments that are offered are Bass / Drum Kits / Guitars / Mallets / Organs / Pianos and Keyboards / Synth Basics / Synth Leads / Synth Pads.  Most of these that I've tried seem to work and give their characteristic sound when placed in a particular channel and playback is clicked. 
    However - there is one orchestra instrument offered in the standard Logic Pro 8 Mixer channel menu and it's the item labelled "Performance - 000 flute 1 or 001 flute 1."  And it is this instrument that presents a problem. When I click on it and choose it from the menu and enter it as the instrument of choice for a specfic channel / track in my Logic Pro project arrangement, when playing back the music for the overall piece this particular track, the flute, does not playback and produce the notes (Midi events) in the track in the sound of the flute.  Instead, nothing comes out at all.  I can't imagine why this does not work.  Any ideas, anyone? Again, when choosing this instrument for a track and clicking the playback no flute sound is forthcoming.  Why not? I have not tried them all, but when most of the other various types of keyboards, such as an electric piano or an organ, are chosen for a track the playback successfully renders the sound of these instruments.  Why then does playback not produce the sound of the flute when it has clearly been chosen to play and sound the Midi events given it?
    Anyway, the overall, larger issue for me is the inability I have to choose and get non-Garageband instruments (largely orchestral) to play the Midi events given on various tracks. If my guess is correct then technically, orchestral instruments not offered in the standard Logic Pro 8 Garageband Mixer channel menu are referred to as external Midi sampled instruments - still, IMHO the process is not clearly spelled out in the User Manual.  The simple step by step process whereby a non-Garage band instrument, say an orchestral instrument, is placed in a channel replete with Midi event (notes) waiting to be played should be easy, logical and given in a simple to follow format, but is not.
    What with all the talk of routes, busses, auxillary channels, GM devices, GM mixers, audio bins, libraries and audio files this Logic Pro User is confused to the max.  Can someone please help me and, in simple English, describe the step by step process whereby presumably external sampled orchestral instruments can be successfully employed, in any given Logic Pro arrangement project, to render their characteristic sounds upon playback?
    On my two Macs, one a laptop and one a much larger Mac, I have any number of the GSO (Garritan Symphony Orceshtra) and Vienna Symphony Orchestra instrument library samples - and yet - I've yet to figure out how to actually get them INTO a Logic Pro project of any kind!  To put this as a question, even as a humble request, how can I make good use of these orchestral sample libraries in a Logic Pro project?  Can someone steer my to a clear resolution of this issue.  I'd sincerely appreciate it!  Thanks all! 
    DavidBacon

    DavidBacon wrote:
    Anyway, the overall, larger issue for me is the inability I have to choose and get non-Garageband instruments (largely orchestral) to play the Midi events given on various tracks. If my guess is correct then technically, orchestral instruments not offered in the standard Logic Pro 8 Garageband Mixer channel menu are referred to as external Midi sampled instruments - still, IMHO the process is not clearly spelled out in the User Manual.  The simple step by step process whereby a non-Garage band instrument, say an orchestral instrument, is placed in a channel replete with Midi event (notes) waiting to be played should be easy, logical and given in a simple to follow format, but is not.
    What with all the talk of routes, busses, auxillary channels, GM devices, GM mixers, audio bins, libraries and audio files this Logic Pro User is confused to the max.
    David,  you understand that this is professional software and is not necessarily meant to be easy but is in fact designed to give the professional user as many choices as possible, that's why it's in the Pro Apps section. You WILL need to learn about buses, GM Devices, Audio Bins, Libraries...etc..etc if you intend to use Logic.
    That said, you are looking in the wrong place in the channel strip.
      May I offer you advice?
    Go here:
    http://documentation.apple.com/en/logicpro/
    Open "Exploring Logic Pro"  (a short PDF Document). Pay special attention to chapter 3. Also pay special attention to the included graphics of the channel strips.
    I encourage you to read the whole document as it will clear up many things... even though it's a Logic 9 document.
    Post back

Maybe you are looking for

  • HP1102w installing on MAC OSX 10.6.8 with wifi Netgear DG834GT router

    HI. I am still having problems. 1 - after installing HP software, in my application folder there is no software related to 1102w. I have the Photosmart A320 and I can see her in the folder. She is connected by USB, no problem. 2 - After installing HP

  • Raw video import

    Hi there, I use a canon M31 for my video recording. To date I have been importing a video into Imovie, then immediately exporting the full unedited video to a folder for safe keeping while I edit the original import. What I would like to do is save a

  • SUB-Group consol. in different currency i.e. other than group currency

    HI Friends, Consolidation Group currency is "USD". In the consolidation hierarchy, i have one sub group where all the companies are in AUD. Now the requirement is that australian sub group requires sub consolidation in AUD. Currently we are doing sun

  • Use TC as temporary AEBSn Until Time Machine is Set Up & ready for B/U?

    I want to set up TC by itself with iMac and MBPro and use the same as AEBSn until I set up Time machine on each computer. I have Leopard on both, but with extended first backup times that I have been reading about I want to have TC ready to go but se

  • Configuring help

    When pressing the help button, the browser still starts with an URL pointing to 4.7, but we are on ERP 2005. Where can i configure/change this so that the ERP 2005 help files are shown?