Returning List String or String[][] in JNI

Hi,
I am calling a native function in C++ from Java which has to return List<String> or String[][]. Is this possible?
The java declaration is - private native List<String> GetListNative();
In C++ the declaration is:
JNIEXPORT jobject JNICALL Java_com_GetListNative
(JNIEnv *env, jobject obj);
Please help!
Thanks in advance...
Message was edited by:
arjundg

try treating String[][] as array of arrays of strings
I mean consider your 2D array as a 1D array and each of its elements is an array of Strings
I think this will work

Similar Messages

  • Trouble returning String from JNI method

    I'm a JNI newbie who is going through the SUN online book on JNI and have put together the 2nd program example (right after "helloworld"), but it is not working right. It is supposed to prompt you for a string, then returns the string that you type in. Right now it compiles without error, but it returns only the first word that I type, not the whole sentence. What am I doing wrong?
    Here's the code:
    Prompt.java
    package petes.JNI;
    public class Prompt
        private native String getLine(String prompt);
        static
            System.loadLibrary("petes_JNI_Prompt");
        public static void main(String[] args)
            Prompt p = new Prompt();
            String input = p.getLine("Type a line: ");
            System.out.println("User typed: " + input);
    }petes_JNI_Prompt.h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class petes_JNI_Prompt */
    #ifndef _Included_petes_JNI_Prompt
    #define _Included_petes_JNI_Prompt
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     petes_JNI_Prompt
    * Method:    getLine
    * Signature: (Ljava/lang/String;)Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_petes_JNI_Prompt_getLine
      (JNIEnv *, jobject, jstring);
    #ifdef __cplusplus
    #endif
    #endifpetes_JNI_Prompt.c
    #include <jni.h>
    #include <stdio.h>
    #include "petes_JNI_Prompt.h"
    JNIEXPORT jstring JNICALL Java_petes_JNI_Prompt_getLine
      (JNIEnv *env, jobject this, jstring prompt)
         char buf[128];
         const jbyte *str;
         str = (*env)->GetStringUTFChars(env, prompt, NULL);
         if (str == NULL)
              return NULL;  /*  OutOfMemoryError already thrown */
         printf("%s", str);
         (*env)->ReleaseStringUTFChars(env, prompt, str);
         // assume here that user will ty pe in 127 or less characters
         scanf("%s", buf);
         return (*env)->NewStringUTF(env, buf);
    }Thanks in advance!
    /Pete

    OK, I have something that works now by substituting fgets for scanf. I have two other questions:
    1) Do I need to free the memory created in buf? Will it allocate memory every time the method is run? Or will it allocate only once on creation, and so is no big deal?
    2) A minor question: When I run this program in eclipse, the prompt string is displayed in the console only after the input string is entered and displayed. It works fine when I run it from the command line however. I have a feeling that this is a problem with how Eclipse deals with native methods and perhaps nothing I can fix. Any thoughts?
    Thanks
    Pete
    Addendum, the updated code:
    #include <jni.h>
    #include <stdio.h>
    #include "petes_JNI_Prompt.h"
    JNIEXPORT jstring JNICALL Java_petes_JNI_Prompt_getLine
      (JNIEnv *env, jobject this, jstring prompt)
         char buf[128];
         const jbyte *str;
         str = (*env)->GetStringUTFChars(env, prompt, NULL);
         if (str == NULL)
              return NULL;  /*  OutOfMemoryError already thrown */
         printf("%s", str);
         (*env)->ReleaseStringUTFChars(env, prompt, str);
         //scanf("%s", buf);
         fgets(buf, 128, stdin);
         return (*env)->NewStringUTF(env, buf);
    }Message was edited by:
    petes1234

  • How can i get also the files in the root directory and how can i for testing add items of IEnumerable FTPListDetail to List string ?

    What i get is only the directories and files that in other nodes. But i have also files on the root directory and i never
    get them. This is a screenshot of my program after i got the content of my ftp. I'm using treeView to display my ftp content:
    You can see two directories from the root but no files on the root it self. And in my ftp server host i have files in the root direcory.
    This is the method i'm using to get the directory listing:
    public IEnumerable<FTPListDetail> GetDirectoryListing(string rootUri)
    var CurrentRemoteDirectory = rootUri;
    var result = new StringBuilder();
    var request = GetWebRequest(WebRequestMethods.Ftp.ListDirectoryDetails, CurrentRemoteDirectory);
    using (var response = request.GetResponse())
    using (var reader = new StreamReader(response.GetResponseStream()))
    string line = reader.ReadLine();
    while (line != null)
    result.Append(line);
    result.Append("\n");
    line = reader.ReadLine();
    if (string.IsNullOrEmpty(result.ToString()))
    return new List<FTPListDetail>();
    result.Remove(result.ToString().LastIndexOf("\n"), 1);
    var results = result.ToString().Split('\n');
    string regex =
    @"^" + //# Start of line
    @"(?<dir>[\-ld])" + //# File size
    @"(?<permission>[\-rwx]{9})" + //# Whitespace \n
    @"\s+" + //# Whitespace \n
    @"(?<filecode>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<owner>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<group>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<size>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<month>\w{3})" + //# Month (3 letters) \n
    @"\s+" + //# Whitespace \n
    @"(?<day>\d{1,2})" + //# Day (1 or 2 digits) \n
    @"\s+" + //# Whitespace \n
    @"(?<timeyear>[\d:]{4,5})" + //# Time or year \n
    @"\s+" + //# Whitespace \n
    @"(?<filename>(.*))" + //# Filename \n
    @"$"; //# End of line
    var myresult = new List<FTPListDetail>();
    foreach (var parsed in results)
    var split = new Regex(regex)
    .Match(parsed);
    var dir = split.Groups["dir"].ToString();
    var permission = split.Groups["permission"].ToString();
    var filecode = split.Groups["filecode"].ToString();
    var owner = split.Groups["owner"].ToString();
    var group = split.Groups["group"].ToString();
    var filename = split.Groups["filename"].ToString();
    var size = split.Groups["size"].Length;
    myresult.Add(new FTPListDetail()
    Dir = dir,
    Filecode = filecode,
    Group = group,
    FullPath = CurrentRemoteDirectory + "/" + filename,
    Name = filename,
    Owner = owner,
    Permission = permission,
    return myresult;
    And then this method to loop over and listing :
    private int total_dirs;
    private int searched_until_now_dirs;
    private int max_percentage;
    private TreeNode directories_real_time;
    private string SummaryText;
    private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
    var directoryNode = new TreeNode(name);
    var directoryListing = GetDirectoryListing(path);
    var directories = directoryListing.Where(d => d.IsDirectory);
    var files = directoryListing.Where(d => !d.IsDirectory);
    total_dirs += directories.Count<FTPListDetail>();
    searched_until_now_dirs++;
    int percentage = 0;
    foreach (var dir in directories)
    directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
    if (recursive_levl == 1)
    TreeNode temp_tn = (TreeNode)directoryNode.Clone();
    this.BeginInvoke(new MethodInvoker( delegate
    UpdateList(temp_tn);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    foreach (var file in files)
    TreeNode file_tree_node = new TreeNode(file.Name);
    file_tree_node.Tag = "file" ;
    directoryNode.Nodes.Add(file_tree_node);
    numberOfFiles.Add(file.FullPath);
    return directoryNode;
    Then updating the treeView:
    DateTime last_update;
    private void UpdateList(TreeNode tn_rt)
    TimeSpan ts = DateTime.Now - last_update;
    if (ts.TotalMilliseconds > 200)
    last_update = DateTime.Now;
    treeViewMS1.BeginUpdate();
    treeViewMS1.Nodes.Clear();
    treeViewMS1.Nodes.Add(tn_rt);
    ExpandToLevel(treeViewMS1.Nodes, 1);
    treeViewMS1.EndUpdate();
    And inside a backgroundworker do work how i'm using it:
    var root = Convert.ToString(e.Argument);
    var dirNode = CreateDirectoryNode(root, "root", 1);
    e.Result = dirNode;
    And last the FTPListDetail class:
    public class FTPListDetail
    public bool IsDirectory
    get
    return !string.IsNullOrWhiteSpace(Dir) && Dir.ToLower().Equals("d");
    internal string Dir { get; set; }
    public string Permission { get; set; }
    public string Filecode { get; set; }
    public string Owner { get; set; }
    public string Group { get; set; }
    public string Name { get; set; }
    public string FullPath { get; set; }
    Now the main problem is that when i list the files and directories and display them in the treeView it dosen't get/display
    the files in the root directory. Only in the sub nodes.
    I will see the files inside hello and stats but i need also to see the files in the root directory.
    1. How can i get and list/display the files of the root directory ?
    2. For the test i tried to add to a List<string> the items in var files to see if i get the root files at all.
       This is what i tried in the CreateDirectoryNode before it i added:
    private List<string> testfiles = new List<string>();
    Then after var files i did:
    testfiles.Add(files.ToList()
    But this is wrong. I just wanted to see in testfiles what items i'm getting in var files in the end of the process.
    Both var files and directoryListing are IEnumerable<FTPListDetail> type.
    The most important is to make the number 1 i mentioned and then to do number 2.

    Risa no.
    What i mean is this. This is a screenshot of my ftp server at my host(ipage.com).
    Now this is a screenshot of my program and you can see that in my program i have only the directories hello stats test but i don't have the files in the root: htaccess.config swp txt 1.txt 2.png....all this files i don't have it on my treeView.
    What i want it to be is that on my program on the treeView i will also display the files like in my ftp server.
    I see in my program only the directories and the files in the directories but i don't see the files on the root directory/node.
    I need it to be like in my ftp server i need to see in my program the htaccess 1.txt 2.png and so on.
    So what i wrote in my main question is that in the var files i see this files of the root directory i just don't know to add and display them in my treeView(my treeView is treeViewMS1).
    I know i checked in my program in the method CreateDirectoryNode i see in the first iteration of the recursive that var files contain this root files i just dont know how to add and display them in my treeView.
    On the next iterations when it does the recursive it's adding the directories hello stats test and the files in this directories but i need it to first add the root files.

  • SharePoint Btach Process with List string items into list

    Hi 
    I have a List<string> with 8000 elements.
    I need to take 1000 everytime and run the batch process to insert data into list.
    I cant apply all 8000 items in one shot.
    Can you please suggest me that how  i can query List<string> and execute.
    Thanks
    Siddartha

    You need to use Skip and Take methods of your object collection.
    Example:
    list.Skip(1000).Take(1000)
    This would skip the first 1000 and take the next 1000.
    You'd just need to increase the amount skipped with each call
    List<string> list = new List<string>();
    //Code to get 8000 elements
    for (int index = 0; index < 8; index++)
    List<string> batchList = GetBatch(index, list);
    //Code to insert data into list
    And here is the GetBatch method...
    public List<string> GetBatch(int pageNumber, List<string> list)
    return list.Skip(pageNumber * 1000).Take(1000);
    I found the answer
    here.

  • Traversing var of type List List String

    hello all,
    i hope someone can help me with this little problem.
    im still a newbie on java devt.
    the problem is, i have retrieved some records from a database
    and i am trying to display it on a table. but i am having some issues
    with traversing the info returned to me, which is of type List<List<String>>.
    im using SWT by the way.
    here is the code snippet of my function:
    ================================
    * Displays the search result on the table
    * @param searchResult - search result returned after db query
    public void populateTable (List<List<String>> searchResult) {
    logger_.debug("===SearchView::populateTable()=== - START");
    logger_.debug("searchResult received: " + searchResult.toString());
    //traverse rows
    List <String> row = new ArrayList<String>();
    for (int i = 0; i < searchResult.size(); ++i) {
    row = searchResult.get(i);
    logger_.debug("row value: " + row);
    if ( (row != null) && (!row.isEmpty()) ) {
    //get row attribs
    String custId = row.get(0);
    String custName = row.get(1);
    String custAdd = row.get(2);
    String custContact = row.get(10);
    String custPhone = row.get(11);
    TableItem tableItem = new TableItem(searchTable_, SWT.NONE);
    tableItem.setText( new String[] { custId, custName, custAdd, custContact, custPhone } );
    logger_.debug("===SearchView::populateTable()=== - END");
    ================================
    thanks,
    doods

         * Displays the search result on the table
         * @param searchResult
        public void populateTable (List<List<String>> searchResult) {
            logger_.debug("===SearchView::populateTable()=== - START");
            logger_.debug("searchResult received " + searchResult.toString());
            logger_.debug("searchResult.size() = " + searchResult.size());
            //traverse rows
            List <String> row = new ArrayList<String>();
            for (int i = 0; i < searchResult.size(); ++i) {
                row = searchResult.get(i);
                logger_.debug("row value: " + row);
                if ( (row != null) && (!row.isEmpty()) ) {
                    //get row attribs
                    String custId = row.get(0);
                    String custName = row.get(1);
                    String custAdd = row.get(2);
                    String custContact = row.get(10);
                    String custPhone = row.get(11);
                    TableItem tableItem = new TableItem(searchTable_, SWT.NONE);
                    tableItem.setText( new String[] { custId, custName, custAdd, custContact, custPhone } );
    //        Iterator <List<String>> iter = searchResult.iterator();
    //        List <String> row = new ArrayList<String>();
    //        while (iter.hasNext()) {
    //            row = iter.next();
    //            String custId = row.get(0);
    //            String custName = row.get(1);
    //            String custAdd = row.get(2);
    //            String custContact = row.get(10);
    //            String custPhone = row.get(11);
    //            logger_.debug(row.toString());
    //            logger_.debug(row.size());
    //            TableItem tableItem = new TableItem(searchTable_, SWT.NONE);
    //            tableItem.setText( new String[] { custId, custName, custAdd, custContact, custPhone } );
            logger_.debug("===SearchView::populateTable()=== - END");
        }sorry bout the code formatting.
    i have already tried using the iterator but it doesn't work.
    is this the right way to use the iterator?
    i commented it out already.
    basically, the searchResult returns 3 rows,
    when i try to print the records on the table, it displays 3 rows
    but the info on those 3 rows are all from the first row.
    ex: row1 = doods, 123, aaa
    row2 = doodies, 333, bbb
    row3 = doodles, 444, ccc
    whats printed on the table:
    doods, 123, aaa
    doods, 123, aaa
    doods, 123, aaa

  • Any way to assign value for  variable of type Class List String ?

    I'm puzzled why I can declare a variable:
    Class<List<String>> clazz;but I cannot assign a value to it as
    clazz = List<String>.class;The compiler also complains about
    Class<List<?>> clazz0 = List<?>.class;yet it has the nerve to warn about raw types when I give up and use
    Class<List> clazz0 = List.class;Even using a dummy instance does not work.
            List<String> dummy = new ArrayList<String>();
            Class<List<String>> clazz1 = dummy.getClass();I only care because I've declared a method like
    public String useless( Class<List<String>> unSetable){
      return  unSetable.getName();
    }And now there seems to be no way to call it.

    Hello chymes,
    there is no way to get an instance of Class<List<String>> without at least one unchecked warning. Otherwise you could get away with the following:
    List<Integer> ints = new ArrayList<Integer>();
    Class<List<String>> clazz = List<String>.class;
    List<String> strings = clazz.cast(ints);
    strings.add("No Good");
    int i = ints.get(0); // CCETherefore the only way to get it is via unchecked cast:
    Class<List<String>> clazz = (Class<List<String>>) (Object) List.class;With kind regards
    Ben

  • List String

    Hi again,
    I was just searching for someting and found out something that Sabre150 post:
    public static List<String> head(File file, int numberOfLinesToRead) throws IOException
            return head(file, "ISO-8859-1" , numberOfLinesToRead);
        }Can anybody tell me what is the meaning of <String> next to the return object? What does it do?
    Many Thanks
    Titus

    means that all the objects in the List must be Strings
    so if you try to add an Integer for example into the List, I think it will give you an error because you already told it that it will be a String list

  • How to use List String in JSP page?

    Hello All,
    I am having problem using List<String> in my JSP page. Below is my JSP code.
    <%@ page import="java.util.*, java.io.*"%>
    <html>
    <body>
    <h1 align="center">Beer Recommendations JSP</h1>
    <p>
    <%
    List<String> beerBrands = (List<String>)request.getAttribute("styles");
    Iterator<String> it = beerBrands.iterator();
    while(it.hasNext()){
         out.print("<br>try: " + it.next());
    %>
    </body>
    </html>
    When I compile the above JSP code in Eclipse 3.4 (using JBoss 4.2 as my Application Server), I get the following Warning.
    Type safety: Unchecked cast from Enumeration to Enumeration<String>
    If I add the "@SuppressWarnings("unchecked")" to the code, Eclipse does not give any Error during compilation. But, at runtime, I get the following Error.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 10 in the jsp file: /BeerAdvice.jsp
    Syntax error, annotations are only available if source level is 5.0
    7: <p>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    The type List is not generic; it cannot be parameterized with arguments <String>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    Syntax error, parameterized types are only available if source level is 5.0
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    Any help is very much appreciated.
    Thank you for your help.
    Thanks,
    Chubha

    Hi anotherAikman,
    Thank you for your help. I currently have the following version of the Java.
    {color:#800000}java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
    {color:#000000}{color:#000000}Does it mean I have Java SE Version 6 Update 17 and you are suggesting me to download the Java EE Version 6?{color} If this is correct, can you please let me know what difference does it make?
    I am now going to install the Java EE 6 and try this out.
    Thank you for your help.{color}
    {color:#000000}Thanks,
    Chubha{color}
    {color}

  • How do I open a .nrl extension in firefox, currently it returns a string of text instead of opening the file with the default program.

    When I click on a .nrl file extension (belongs to Autonomy I-Manage Software) it returns a string of code (what is in the shortcut link) instead of following the link and returning the document. Is there a way to tell Forefox connect to the document that the shortcut is linked to? The .nrl file extension belongs to a piece of software called FileSite (document management system).

    '''Adding download actions''' is the relevant section of that article for your situation.
    Is the *.nrl file on a website or already saved to your PC?
    If it is on a website, the server may not be sending the appropriate Mime-Type telling Firefox how that file is to be handled - ''"Content-Disposition"''.
    Can you give us the URL of the webpage where you have this problem? <br />
    So we can see first hand what the issue is.

  • Returning XML String From Servlet

              Is there a simple way to disable the HTML character escaping when returning
              a string from a servlet. The returned string contains well formed XML, and
              I don't want the tags converted to > and < meta characters in the
              HTTP reply.
              The code is basically "hello world", version 7.0 SP2.
              Thanks
              > package xxx.servlet;
              >
              > import weblogic.jws.control.JwsContext;
              >
              >
              > /**
              > * @jws:protocol http-xml="true" form-get="false" form-post="false"
              > */
              > public class HelloWorld
              > {
              > /** @jws:context */
              > JwsContext context;
              >
              > /**
              > * @jws:operation
              > * @jws:protocol http-xml="false" form-post="true" form-get="false" soap-s
              tyle="document"
              > * @jws:return-xml xml-map::
              > * <HelloWorldResponse xmlns="http://www.xxx.com/">
              > * {return}
              > * </HelloWorldResponse>
              >
              > * ::
              > * @jws:parameter-xml xml-map::
              > * <HelloWorld xmlns="http://www.xxx.com/">
              > * <ix>{ix}</ix>
              > * <contents>{contents}</contents>
              > * </HelloWorld>
              >
              > * ::
              > */
              > public String HelloWorld(String s)
              > {
              > return "<a> xyz </a>";
              > }
              > }
              

              Radha,
              We have a client/server package which speaks SOAP over a
              streaming HTTP channel for which we are writing a WebLogic
              servlet. For reasons of efficiency, we want to deserialize
              only the very top-level tags of the messages as they pass
              through the servlet. Yes, in theory, we should probably
              deserialize and validate the entire message contents...
              When we add support for other clients, we will fully
              deserialize inside those servlets.
              I have not looked any further into how to stop the inner
              tags from being escaped yet -- it is an annoyance more than
              a disaster, since the client handle meta escapes.
              My current guess is to use ECMAScript mapping...
              -Tony
              "S.Radha" <[email protected]> wrote:
              >
              >"Tony Hawkins" <[email protected]> wrote:
              >>
              >>Is there a simple way to disable the HTML character escaping when returning
              >>a string from a servlet. The returned string contains well formed XML,
              >>and
              >>I don't want the tags converted to > and < meta characters in the
              >>HTTP reply.
              >>
              >>The code is basically "hello world", version 7.0 SP2.
              >
              >>
              >>Thanks
              >>
              >>> package xxx.servlet;
              >>>
              >>> import weblogic.jws.control.JwsContext;
              >>>
              >>>
              >>> /**
              >>> * @jws:protocol http-xml="true" form-get="false" form-post="false"
              >>> */
              >>> public class HelloWorld
              >>> {
              >>> /** @jws:context */
              >>> JwsContext context;
              >>>
              >>> /**
              >>> * @jws:operation
              >>> * @jws:protocol http-xml="false" form-post="true" form-get="false"
              >>soap-s
              >>tyle="document"
              >>> * @jws:return-xml xml-map::
              >>> * <HelloWorldResponse xmlns="http://www.xxx.com/">
              >>> * {return}
              >>> * </HelloWorldResponse>
              >>>
              >>> * ::
              >>> * @jws:parameter-xml xml-map::
              >>> * <HelloWorld xmlns="http://www.xxx.com/">
              >>> * <ix>{ix}</ix>
              >>> * <contents>{contents}</contents>
              >>> * </HelloWorld>
              >>>
              >>> * ::
              >>> */
              >>> public String HelloWorld(String s)
              >>> {
              >>> return "<a> xyz </a>";
              >>> }
              >>> }
              >>
              >>
              >Hi Tony,
              >
              > Can you let me know for what purpose you want to disable the
              >HTML character
              >escaping.In case if you
              >
              >have tried this using someway,pl. let me know.
              >
              >rgds
              >Radha
              >
              >
              

  • Queue returns blank strings from template VI

    I have created a master VI which creates a named queue, this VI then spawns multiple copies of a template VI. These sub VIs all gain access to the queue and try writing data to it. I understood that the queue VI was protected so this should not cause a problem. Infact this does not work at all, when i extract element within the master VI it only finds a few of the elements and returns blank strings between. Help what is going on. I am not destroying the queue or such, it seems to be a problem with the protection of the queue when using template VIs.
    Cheers Tom.

    I have not been able to reproduce the problem on LV 6.0.2 Win98. Do you check the error cluster when an empty element is returned? Posting your code might help to find the problem.
    LabVIEW, C'est LabVIEW

  • WINE err:"wine cmd.exe /c echo '%ProgramFiles%' returned empty string"

    So as the tittle states WINE is throiwng this error:
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    As for what might have caused it? probably the last system update which was performed a few days ago, my old prefix works fine but I have a habit of creating new prefixes for troublesome applications, or applications I am unsure of whether they will cause trouble or not.
    Hence I created a new prefix using:
    export WINEARCH=win32
    export WINEPREFIX=~/.problematic
    winecfg
    As for how wine is run, it's run as a normal, unprivileged, user.
    Oh and I also tried generating yet another prefix like this:
    $ WINEARCH=win32 WINEPREFIX=~/.problematic-new winetricks steam
    Executing w_do_call steam
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    Didn't work either.
    I'm at loss, any suggestion on how to fix it?
    Last edited by CubeGod (2014-06-29 15:48:05)

    $ WINEARCH=win32 WINEPREFIX=~/testprefix notepad.exe
    bash: notepad.exe: command not found
    So obviously I need to correct the command
    $ WINEARCH=win32 WINEPREFIX=~/testprefix wine notepad.exe
    wine: created the configuration directory '/home/shiina/testprefix'
    err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: cannot open shared object file: No such file or directory
    fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
    fixme:iphlpapi:NotifyAddrChange (Handle 0xece880, overlapped 0xece88c): stub
    wine: configuration in '/home/shiina/testprefix' has been updated.
    Wine cannot find the ncurses library (libncursesw.so.5).
    why is ncurses a dependency anyway? besides, wicd-curses works so this shouldn't be the case.
    Anyway, trying winetricks in the same prefix
    $ WINEARCH=win32 WINEPREFIX=~/testprefix winetricks steam
    Executing w_do_call steam
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    Anyway, I expected notepad to work since it resides in %WINDOWS% not %ProgramFiles%
    Is there any registry key I can set for this? all my google searching says this can cause with a mismatch of wine versions but why would that happen?
    Either way checking wine --version outputs wine-1.7.20 which is the same as it was pre-update (when it still worked).

  • Calling c function that return a string

    Hallo,
    I found an example for calling void c function(http://zone.ni.com/devzone/cda/epd/p/id/1513). I could adapt the example and make the function return an integer. the code of the adapted function would look like this:
     int __declspec(dllexport) multiply(int number) {return number*3; }
    But I have problems when I want to return a string. Does someone knows how I should do. I tried:
     char* __declspec(dllexport) say(int number) {return "hallo"; }  
    but won't compile.

    yes the question was  more a c question then a labview question. I found the solution anyway, the correct code in order to get string is:
    _declspec(dllexport) char* testchar2();_declspec(dllexport) char* testchar2() {      return "hallo"; }

  • Error returning large String arrays from web service

    Hi,
    I currently have an EJB that returns a String[] array that I have implemented as
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
    as long as the returned array is relatively small, but when the array starts to get
    a little larger (say 20 elements, about 30 chars each), I consistently get:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running under MS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
    array elements in one call. And since I am calling the same Weblogic EJB with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I might be doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

    Hi Steve,
    Sure we're interested...I'll pass this along to the XML folks.
    Thanks for the feedback,
    Bruce
    Steve Alexander wrote:
    In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
    - thinking it was a size issue when it actually was a data issue. On the calls where
    I was returning a large array, some of the array members were null. When I made them
    enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
    the nulls, whereas the MS parser doesn't care.
    "Steve Alexander" <[email protected]> wrote:
    Thanks Bruce,
    FYI - I have reproduced the problem on WL7.0. I have turned it in to support
    as you
    suggested.
    Steve
    Bruce Stephens <[email protected]> wrote:
    Hi Steve,
    This does not ring any bells, however I would suggest that you file a support
    case. If it
    is an option you might try a later release (7.0).
    Bruce
    Steve Alexander wrote:
    Hi,
    I currently have an EJB that returns a String[] array that I have implementedas
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
    as long as the returned array is relatively small, but when the arraystarts to get
    a little larger (say 20 elements, about 30 chars each), I consistentlyget:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running underMS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
    array elements in one call. And since I am calling the same Weblogic
    EJB
    with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I mightbe doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

  • What does and mean in "List String "?

    Anyone familiair with this line:
    List<String> list = new ArrayList<String>(c)what does the "<String>" part precisely mean? I've been through the documentation, but I've not been able to find out what those "<" and ">" represent. Now I know that brackets ("[ ]") are used for arrays, but I doubt wether it's an principal equallity.
    So if someone knows its true meaning and/or has a nice URL for me to glance through some nice documentation...
    Thanks in advance!
    Tensos

    too late, it already did... seeing the code below (encountered in the general
    documentation), I'm afraid you're right...
    Object[] toArray();
    <T> T[] toArray(T[] a);An extra functionality is fine with me, but it is a
    pity that it doesn't make the code more easy readible
    (yet).It's easy to read once you get used to it, and I don't know how they would have been able to add generics with a syntax which is easier to understand, and yet is compact.
    Kaj

Maybe you are looking for

  • Osx 10.5.7 Web Sharing not working

    Web Sharing wasn't working for me when I turned it on. here is the output of apachectl configtest $ apachectl configtest dyld: Library not loaded: /usr/lib/libaprutil-1.0.dylib Referenced from: /usr/sbin/httpd Reason: no suitable image found. Did fin

  • SAP help files

    Hi, I want to download SAP help files from sap.help.com. But from where I should download. Samriddhi Edited by: samriddhi das on Dec 15, 2008 12:51 PM

  • [FR] BB10 should support automatic filtering using Sieve

    It would be great if BB10 could support automatic email filtering/filing. Sieve works great for IMAP based mail systems, which is what most people will use besides Activesync. When the user needs to modify rules, BB10 devices would simply need to con

  • Forgot pass code, need to back it up and clear it

    Hi, does anybody know how to back my iPod touch up to a computer so I can wipe it clean and get rid of the pass code on it please? I've forgotten my passcode so can't get into my iPod....any help would be grateful, the simpler the better as I'm not v

  • How you complete impact analysis for SAP Universe

    hi, i want to know that how to how you complete impact analysis for SAP Universe