C++ do not support  JNi && how to return the array from jni?

hi,
1.. I have created the Cpp file to implemement the native method but it seems that the native method can not complie rightly , it tells me follows
error C2819: type 'JNIEnv_' does not have an overloaded member 'operator ->'
c:\program files\microsoft visual studio\vc98\include\jni.h(764) : see declaration of 'JNIEnv_'
c:\users\wangyue\desktop\java_gui\beattrack 5.6 - ������_������_������������ 5.7\beattrack.cpp(202) : error C2227: left of '->GetByteArrayRegion' must point to class/struct/union
then I use the c file to paste the same code, it can complie rightly , why? I really need my native method to complie rightly in Cpp file, how to solve it?
2.I want to return a double, for the most simple way, I do the following
#include "RealBeatTrack_BeatTrack.h"
JNIEXPORT jdoubleArray JNICALL Java_playaudio_BeatTrack_BeatTrack
(JNIEnv *env, jobject j, jbyteArray data)
jdouble outdata[4]={1,2,3,4};
return (*env)->NewDoubleArray(env, outdata);
then in the java code, I difine a array to receive it,
say double mydata[] = new double[4];
mydata= BeatTrack(buffedata);
but the java comlier tells me the Exception in thread "Thread-2" java.lang.OutOfMemoryError: Java heap space?
anyone can help me?
Thanks

thanks for your reply
another problem of my!
the jni pass the string, I then convert it to the
const char* filename = env->GetStringUTFChars(fname,NULL);
then I use the filename to opent the file but fails, what is the problem???
FILE *fp= fopen(filename,"w"); // there are some problem here!!!
     fprintf(fp, "%s\n","wangyue fighting!");
the error is as follows
# An unexpected error has been detected by Java Runtime Environment:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0bfc1a55, pid=7040, tid=11384
# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode windows-x86)
# Problematic frame:
# C [beattrack.dll+0x1a55]
# An error report file with more information is saved as:
# D:\programs\playAudio\hs_err_pid7040.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Similar Messages

  • Returning the string from the SimpleDateFormat

    Hi guys,
    Can someone tell me how to return the string from the SimpleDateFormat?
    I've created the method to do this, but i don't know the exact code to use. Here's my code so far...
        public String convert (Calendar gc)
            String s = convert(gc);
            return // I need to return the s here, but don't know how to code it.
        }BTW, i've already wrote the code for the SimpleDateFormat (so if you want me post that, i will).

    DrLaszloJamf wrote:
    LevelSix wrote:
    DrLaszloJamf wrote:
    No.Can you tell me what it is, because i've went through the API and i don't know.
    Have you looked for a tutorial: [http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html]
    Thanks a lot DrLaszloJamf, this is useful.
    DrClap wrote:
    Nope. Suppose you were on a construction site and the foreman told you to move a pile of concrete blocks from a truck into the building. What do you suppose would happen if you asked the foreman what a concrete block was, and where the building was, and whether you should drive the truck into the street, and then you tried to pick up the whole pile all at once, and then you asked if you could kick the blocks like footballs? This is what you're doing here. You'd be fired from the construction site within half an hour.Sir...

  • My iPhone 4 Bluetooth, using ios7, cannot identify any other bluetooth device (even other apple products). Says device not supported. How to solve this problem?

    My iPhone 4 Bluetooth, using ios7, cannot identify any other bluetooth device (even other apple products). Says device not supported. How to solve this problem?

    Supported Bluetooth Profiles
    It is not supposed to detect other Apple products via Bluetooth.

  • Hi, I want to purchase adobe photoshop, however I'm based in Zimbabwe and Zambia and I received a notification that these areas are not supported. How do I purchase adobe photoshop using a paypal account?

    Hi, I want to purchase adobe photoshop, however I'm based in Zimbabwe and Zambia and I received a notification that these areas are not supported. How do I purchase adobe photoshop using a paypal account?

    Adobe Resellers http://adobedealreg.force.com/PartnerSearch?lang=en
    -http://www.adobe.com/content/dam/Adobe/en/products/creativecloud/cc/pdfs/cc-availability-m atrix.pdf

  • Mac cant get to a certain website. says does not support netscape.how do i fix this .

    when trying to get to a certain web site, it says can not support netscape. how do i fix this

    what website?

  • Error message pops up:  url files of type "file:" are not supported.  How can I get rid of this?

    Error message pops up:  url files of type "file:" are not supported.  How can I get rid of this?

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • Not sure on how to return a new object

    hi i am not sure on how to return a new Set object, i am not asking how to code this, i just don't exactly know what to write after "return.." to return a new object ...that part of the code is towards the bottom where i put arrows.....this is the skeleton of the code:
    public class Set
         // define fields here
         public Set(int maxinteger)
              // complete this method
         public boolean add(int integer)
              return false; // replace this line with your code
         public boolean remove(int integer)
              return false; // replace this line with your code
         public boolean contains(int integer)
              return false; // replace this line with your code
         public int size()
              return 0; // replace this line with your code
         public String toString()
              return null; // replace this line with your code
         public void addAll(Set other)
              // complete this method
    --------->     public Set subset(int min, int max)
              return null; // replace this line with your code
    ----------->     public Set intersection(Set other)
              return null; // replace this line with your code
    ------------->     public Set difference(Set other)
              return null; // replace this line with your code
         }

    well, when you use return is when trying to make a method have a value that have to be returned from it.
    In your case you have a Set CLASS, with methods, some methods have to return Strings, ints, Objects, etc.
    just make sure that you are returning the same type of value than the method say.
    the method parts are:
    modifier returnType name (parameters) {
    . code
    modifiers are public, private, etc.
    the return type specifies what the method will return, for example:
    public String toString () {
    must return a String value.
    to return a new Object just do it like a simple value, Strings are objects.
    just define a Set object and then return it.

  • HT201184 AT&T does not support Safari how do I pay my bills

    AT&T does not support Safari how do I pay my bills?

    That is very much a personal choice. Opera? Firefox? Chrome? In this case it may be a matter of what works for the ATT site. Although I have not seen another post regarding Safari not working with AT&T site.

  • [UIX] How To: Return multiple values from a LOV

    Hi gang
    I've been receiving a number of queries via email on how to return multiple items from a LOV using UIX thanks to earlier posts of mine on OTN. I'm unfortunately aware my previous posts on this are not that clear thanks to the nature of the forums Q&A type approach. So I thought I'd write one clear post, and then direct any queries to it from now on to save me time.
    Following is my solution to this problem. Please note it's just one method of many in skinning a cat. It's my understanding via chatting to Oracle employees that LOVs are to be changed in a future release of JDeveloper to be more like Oracle Forms LOVs, so my skinning skills may be rather bloody & crude very soon (already?).
    I'll base my example on the hr schema supplied with the standard RDBMS install.
    Say we have an UIX input-form screen to modify an employees record. The employees record has a department_id field and a fk to the departments table. Our requirement is to build a LOV for the department_id field such that we can link the employees record to any department_id in the database. In turn we want the department_name shown on the employees input form, so this must be returned via the LOV too.
    To meet this requirement follow these steps:
    1) In your ADF BC model project, create 2 EOs for employees and departments.
    2) Also in your model, create 2 VOs for the same EOs.
    3) Open your employees VO and create a new attribute DepartmentName. Check “selected in query”. In expressions type “(SELECT dept.department_name FROM departments dept WHERE dept.department_id = employees.department_id)”. Check Updateable “always”.
    4) Create a new empty UIX page in your ViewController project called editEmployees.uix.
    5) From the data control palette, drag and drop EmployeesView1 as an input-form. Notice that the new field DepartmentName is also included in the input-form.
    6) As the DepartmentName will be populated either from querying existing employees records, or via the LOV, disable the field as the user should not have the ability to edit it.
    7) Select the DepartmentId field and delete it. In the UI Model window delete the DepartmentId binding.
    8) From the data controls palette, drag and drop the DepartmentId field as a messageLovInput onto your page. Note in your application navigator a new UIX page lovWindow0.uix (or similar) has been created for you.
    9) While the lovWindow0.uix is still in italics (before you save it), rename the file to departmentsLov.uix.
    10) Back in your editEmployees.uix page, your messageLovInput source will look like the following:
    <messageLovInput
        model="${bindings.DepartmentId}"
        id="${bindings.DepartmentId.path}"
        destination="lovWindow0.uix"/>Change it to be:
    <messageLovInput
        model="${bindings.DepartmentId}"
        id="DepartmentId"
        destination="departmentsLov.uix"
        partialRenderMode="multiple"
        partialTargets="_uixState DepartmentName"/>11) Also change your DepartmentName source to look like the following:
    <messageTextInput
        id=”DepartmentName”
        model="${bindings.DepartmentName}"
        columns="10"
        disabled="true"/>12) Open your departmentsLov.uix page.
    13) In the data control palette, drag and drop the DepartmentId field of the DepartmentView1 as a LovTable into the Results area on your page.
    14) Notice in the UI Model window that the 3 binding controls have been created for you, an iterator, a range and a binding for DepartmentId.
    15) Right click on the DepartmentsLovUIModel node in the UI Model window, then create binding, display, and finally attribute. The attribute binding editor will pop up. In the select-an-iterator drop down select the DepartmentsView1Iterator. Now select DepartmentName in the attribute list and then the ok button.
    16) Note in the UI Model you now have a new binding called DCDefaultControl. Select this, and in the property palette change the Id to DepartmentName.
    17) View the LOV page’s source, and change the lovUpdate event as follows:
    <event name="lovSelect">
        <compound>
            <set value="${bindings.DepartmentId.inputValue}" target="${sessionScope}" property="MyAppDepartmentId" />
            <set value="${bindings.DepartmentName.inputValue}" target="${sessionScope}" property="MyAppDepartmentName" />
        </compound>
    </event>18) Return to editEmployees.uix source, and modify the lovUpdate event to look as follows:
    <event name="lovUpdate">
        <compound>
            <set value="${sessionScope.MyAppDepartmentId}" target="${bindings.DepartmentId}" property="inputValue"/>
            <set value="${sessionScope.MyAppDepartmentName}" target="${bindings.DepartmentName}" property="inputValue"/>     
        </compound>
    </event>That’s it. Now when you select a value in your LOV, it will return 2 (multiple!) values.
    A couple things to note:
    1) In the messageLovInput id field we don’t use the “.path” notation. This is mechanism for returning 1 value from the LOV and is useless for us.
    2) Again in the messageLovInput we supply “_uixState” as an entry in the partialTargets.
    3) We are relying on partial-page-refresh functionality to update multiple items on the screen.
    I’m not going to take the time out to explain these 3 points, but it’s worthwhile you learning more about them, especially the last 2, as a separate exercise.
    One other useful thing to do is, in your messageLovInput, include as a last entry in the partialTargets list “MessageBox”. In turn locate the messageBox control on your page (if any), and supply an id=”MessageBox”. This will allow the LOV to place any errors raised in the MessageBox and show them to the user.
    I hope this works for you :)
    Cheers,
    CM.

    Thanks Chris,
    It took me some time to find the information I needed, how to use return multiple values from a LOV popup window, then I found your post and all problems were solved. Its working perfectly, well, almost perfectly.
    Im always fighting with ADF-UIX, it never does the thing that I expect it to do, I guess its because I have a hard time letting go of the total control you have as a developer and let the framework take care of a few things.
    Anyway, I'm using your example to fill 5 fields at once, one of the fields being a messageChoice (a list with countries) with a LOV to a lookup table (id , country).
    I return the countryId from the popup LOV window, that works great, but it doesn't set the correct value in my messageChoice . I think its because its using the CountryId for the listbox index.
    So how can I select the correct value inside my messageChoice? Come to think of it, I dont realy think its LOV related...
    Can someone help me out out here?
    Kind regards
    Ido

  • I just bought an ipod nano and cannot figure out how to sync the music from itunes onto it. i go to itunes and nothing happens. Is there a sync button im not seeing? I get my playlisits but that is it.

    just bought an ipod nano and cannot figure out how to sync the music from itunes onto it. i go to itunes and nothing happens. Is there a sync button im not seeing? I get my playlisits but that is it.
    ALSO does anyone know how to have 2 ipods on 1 computer but seperate?

    Hi there,
    I would recommend taking a look at the information found in the articles below. The first two articles have the same content, but are geared towards either OS X or Windows.
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad
    http://support.apple.com/kb/PH12313
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad
    http://support.apple.com/kb/PH12113
    How to use multiple iPhone, iPad, or iPod devices with one computer
    http://support.apple.com/kb/ht1495
    -Griff W.

  • Short Slo Mo video imported to Aperture or iPhoto via cable (Air Drop not supported on my iMac): only the SloMo section imports. Not the rest. Any fixes?

    Short Slo Mo video imported to Aperture or iPhoto via cable (Air Drop not supported on my iMac): only the SloMo section imports. Not the rest. Any fixes?

    Okay, as I'm working through this I see that I have to add the "Admin" account to each file with "read only" permission.  Simply changing the "everyone" account access does nothing. 
    So how do I change the permissions settings in iPhoto or Aperture to give each exported file the desired permissions?  I cannot locate a setting in the iPhoto or Aperture applications.
    Also, I added a password to the user account.  It did not change how files are output.

  • HT1529 If I do not have the macbook with me and in the bill is not writing? How to get the Serial Number true Itunes?

    If I do not have the macbook with me and in the bill is not writing? How to get the Serial Number true Itunes?

    https://support.apple.com/kb/HT2526

  • I have an iPOD mini library and now have a IPhone 4S.  I updated my library and synced my phone to the library but can not figure out how to get the music library to download to my  iphone

    I have an iPod mini library which I have update. I now have an iPhone 4S which I have synced to the library using a MS XP computer. I can not figure out how to get the library to download to my iPhone?

    Thanks,  This caused me to go back and try again since the solution seemed so simple.  What I did was when it started downloading, it started with the iphones apps to my computer.  I did not want the apps downloaded on my computer so I stopped it.  If I would have waited, the music was uploaded right after the apps were downloaded.

  • Hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.

    hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.
    i do not have a mac home pc. just a regular pc

    I had the same problem after I gave my old iPad to my parents and tried to install Netflix. This is what you have to do:  Open iTunes on your computer, the one you sync your iPad to. Then go to iTunes Store and search for and download Netflix app. After you download it, if your iPad is set to download new purchases it may start downloading on your iPad. If so, tap and hold to delete the app (because it is trying to install the new version on the iPad) Next step, go to the App Store on your iPad and find Netflix and it should say install since you already purchased it on the computer. Tap to install, and it will say the version is not compatible, tap to download a previous version. Click that and it will install the older version!    One more thing, if and when you sync to your computer again it will say something like " Unable to install Netflix on your iPad" Just click the box to never remind you again, because it's trying to sync the newer Netflix app to your iPad, but it doesn't work so it displays the message. The old app will remain on the ipad. Hope this helps, good luck

  • How to return the name (or ID) of the Task FLow in Script

    Sitaution; two task flows created which can be accessed via Tools > TaskFlows within FDQM
    Task Flow "1.1 Multi Load - Import" --> Should run Batch Process Up to Import (enmBatchProcessLevel: 2)
    Task Flow "2.1 Multi Load - Import Up To Validate" --> Should run Batch Process Up to Validate (enmBatchProcessLevel: 4)
    I have developed one generic script which I would like to use for each task flow.
    Only the enmBatchProcessLevel differs between the task flows and therefore I would like to parse this enmBatchProcessLevel as a parameter my generic script.
    To be able to do this, the script needs to know on which task flow a user has clicked. So, I am looking for a function or statement which returns the name (or ID) of the task flow. Based on this name (or ID) a conditional statement can be performed in which a variable is dynamically filled. This variable can then be parsed as a parameter to my generic script.
    For instance:
    Sub GenericRoutine
         Dim strTaskFlow
         Dim intBatchProcessLevel
         '--Get the Task Flow Name
         strTaskFlow = ......<How to return the TaskFlow name or ID?>
         '--Validate the task flow and fill variable intBatchProcessLevel dynamically
         Select Case strTaskFlow
              Case "1.1 Multi Load - Import"
                   intBatchProcessLevel = 2
              Case "2.1 Multi Load - Import Up To Validate"
                   intBatchProcessLevel = 4
         End Select
         '--Execute generic script
         '--Call Batch script and parse intBatchProcessLevel as a parameter:
         Call sBatchProcess(intBatchProcessLevel)
         '--Execute generic script
    End Sub
    Sub sBatchProcess(Byval intBatchProcessLevel)
         Dim lngProcessLevel
         Dim strDelimiter
         Dim blnAutoMapCorrect
         '--Use intBatchProcessLevel to fill lngProcessLevel
         lngProcessLevel = intBatchProcessLevel
         strDelimiter = "_"
         blnAutoMapCorrect = 0
         Set BATCHENG.PcolFiles = BATCHENG.fFileCollectionCreate(CStr(strDelimiter))
         BATCHENG.mFileCollectionProcess BATCHENG.PcolFiles, CLng(lngProcessLevel), , CBool(blnAutoMapCorrect)
    End Sub
    Edited by: user13642656 on Jul 21, 2011 4:55 AM

    Hi, thanks for your reply.
    The Generic script contains 600+ records, which I would like to maintain once, when having multiple Task Flows for Import, UpToValidate, ValidateOnly, UpToExport, ExportOnly etc.
    Is there a central storage in FDQM workbench for script, like a "Module" in Excel VisualBasic environment? Thanks!

Maybe you are looking for

  • Itunes and my ipod wont sync :(

    hi i have recently bought a new laptop preloaded with windows 7. i also downloaded the newest version of itunes. i loaded new music from cds to itunes, authorised my computer nd connected my ipod. my ipod connected for about 5 seconds and then said i

  • PGP Encryption Scenario for a Proxy to File Scenario.

    I have a scenario where an outbound proxy from R/3 system is extracting some hr related info type data and sending it to XI system. The XI system is required to convert the data into a flat file format and encrypt the data using PGP. <b>R/3 - Proxy -

  • Where are user preferences stored? Are they encrypted?

    In a portal application, where are user preferences actually stored? Are they encrypted? If not, is there a way to make them encrypted? The reason I'm asking is the user wants to be able to store their credentials for logging into a mainframe associa

  • Can't get JDK6 docs to work properly

    I just downloaded and unzipped the JDK6 documentation, however when I launch the index.html file in my IE7 browser and click any of the links I get an "Error on page." Any suggestions?

  • Looking for firmware update instead replacing hardware!

    I have bought lenovo g500 laptop and windows 7 x64 installation cd but unfortunately I encountered problems with internet worm attack obviously because I didn't install any software except necessary drivers,internet browsers etc.My PC is acting with