HELP--using a program's header file!

Ok, I have gone thru the jni tutorial and I understand the HelloWorld example... my problem is, in the tutorial the java part calls a C program that they then write... I need to call an existing program that is not written in java? I have this program's header file and that is all.
How do I use this so that my java program can call the existing non java program? What do I do with it, how should/do I make the dll? The methods sigs. in the non java program's header file do not look like the ones created by javah.exe.
please help, and thanks in advance

What you need to do is
1. Design nice java methods that are the equivalent of the C functions. Define them as "native" - no implementation in java.
2. run javah and generate an h file for those methods.
3. Write a dll in c for the new javah-generated .h file. This will be a very thin layer that translates between java and the original dll. In other words, your new dll mostly just calls the functions in the old dll.

Similar Messages

  • Using ODI variable in Header File

    Hi,
    I want to append header/footer file to the main data file.
    Is it possible to do this:
    1) I want to write to the header file - table name, rowcount, .. and various other detials. But i do not want to use an interface/odioutfile/odisqlunload for this.
    2) I want to use ODIvariables and write the varaible value to Header.txt file.
    Is such a thing possible?
    If NO, then what could be the other soultion?
    Thanks.

    Thanks Dev.
    I followed the following steps
    1. Refresh the variable for header (OK)
    2. Call the Variable using OdiOutFile [ Header is populated ] (OK)
    3. Call the Interface SQL to File Append [ In the option have the Header as no since you are getting the Header from the Variable ] (OK )
    When I see my output file its coming as this
    2stt_acct:1234 (2 is the row count - supposed to be a separate line)
    stt_acct:5678
    I wanted the file to be the following
    2 (header representing row counts)
    stt_acct:1234
    stt_acct:5678
    How can I make this happen

  • Using Cpp code and header files with LV8 CIN

    Hello,
    I have three pieces of C++ code and their header files that are called from a Main C++ code.  I want to call these from a LV8, code interface node (CIN).  I have the C++ compiler installed on teh same machine as LV8.  My questions are:
    1) How do I call the C++ code anf the header files from the LV CIN?  I have never doen this. Is there a concise manul for this somewhere?  Teh last thing any self-respecting engineer wants to do is read the manual.
    2)  Once I successfully call teh C++ and header files from within the CIN, can I create a LV runtime executable, just as I can with any other LV8 .vi?  Will this runtime .exe run stand-alone as a distribuatble application?  Do I need to include any special runtime files when I build the exectuable to support teh C++ code?
    Thank you.

    http://forums.ni.com/ni/board/message?board.id=231&message.id=2424&requireLogin=False
    handles your question.

  • Need help using JTextArea to read large file

    Hi here is the deal.
    I've got a large file (about 12Mbytes) of raw data (all of the numbers are basically doubles or ints) which was formed with the ObjectOutputStream.writeInt/writeDouble (I say this to make clear the file has no ascii whatsoever).
    Now I do the file reading on a SwingWorker thread where I read the info from the file in the same order I put it originally.
    I need to convert it to string and visualize it on a JTextArea. It starts working. However a one point (56% to be exact since I know exactly the number of values I need to read) it stops working. The program doesn�t freeze (probably because the other worker thread froze) and I get no exceptions (even tough I�m catching them) and no errors.
    Does anyone have any idea of what the problem could be?
    Thank you very much in advance.
    PD: I don�t know if it matters but I'm using ObjectInputStream with the readInt/readDouble functions to get the values and then turning them to strings and adding them to the JTextArea.

    I can put up the code.
    I don't have it with me right now but I'll do it later.
    Thank you.
    Second. I need to debug a function aproximation that uses a method that has to manage that many numbers. If I don�t put it into a txt and read it there is no way I will know where the problems are, if any. And yes I can look at the txt and figure out problems. It's not that hard.
    What I'll try to do is to write directly to regular txt file instead of doing it to the JTextArea.
    Thank you for your help and I'll post back with the code and results.
    PD: I don't know what profiling is, would you mind telling me?

  • How to extract .sit files(in MAC)  using java program

    Hi,
    please help me , i want to simple program for
    " how to extract .sit files(in MAC) using java program"
    that sit files same as zip files in windows..[                                                                                                                                                                                                                                                                                                                                   

    Thanks for reply...
    but i search in the google about this topic...there is no results will appear..
    the problem is "i have to run program in the MacOS like extract all the
    .sit(StuffIt) extension files. These sit files same as zip files in the windows... we have one tool called StuffIt Expander but it is 3rd party tool. but here requirement is i have to write my own program to extract all the files same as zip file program...
    please do the needful..i am waiting for ur reply,,,

  • How to use Dlls and Header files in my java Code?

    Hi All,
    I want to make use of dll and header files of DataStage, from my Java Interface.
    i am buliding a product where i need to contact DataStage server from my Java Code alone, For this they provided dlls and header files
    Now i wan to make use of them and need to perform DataStage operations from my Java Interface.
    Can any on help out me regarding this?

    Try Java Platform SDK for native function calls without JNI writing code, like it done in .NET languages.
    For MS Windows:
    http://www.simtel.net/product.php[id]100916[SiteID]simtel.net
    For Linux/Unix:
    http://www.simtel.net/product.php[id]117719[SiteID]simtel.net

  • Locating the header files such as msoftcon.h inc++ programing using console graphics lite

    in writing code for the program, I don't know how to locating the header file such as msoftcon.h ,so when this program   was built,an error show "cannot open
    include file:msoftcon.h. I  have already   downloaded  msoftcon.h and msoftcon.cpp from samspublishing website.Please help me how to loate the such header files.

    See this.

  • Reconnecting Referenced Files...every time I use the program! Help!

    Every time I use Aperture, regardless of any outside variables I change, it inevitably unlinks nearly all the photos in my library, or will keep a third linked with no rhyme or reason. I've tested every variable I can think of, stopped using spaces, sent heated emails to our friends at Apple...nothing seems to make a difference. The program is a technological equivalent of a brick 50% of the time I open it.
    These photos are on my main hard drive, not an external disk that gets put to sleep. This problem has occurred while I was in the middle of using the program, switched to finder, switched back.
    Has anyone else had a problem with Referenced Files coming unlinked? Or Can anyone suggest an alternative program to Aperture that actually works?

    Ok, two things I've figured out with 10.5 and Aperture:
    - If you use Spaces, it will eventually cause your referenced images to become unlinked.
    - If you hide or minimize Aperture, it will eventually unlink the album you are working on, and eventually your entire library. Sometimes this problem can be fixed simply by restarting Aperture, but other times, if you let it sit for too long or your computer goes to sleep in this way, your whole library may come unlinked.
    I (so far) haven't had any problems with this since I stopped hiding the application. It is a bug, but at least in my case I'm able to work around it by always keeping the window open if the application is open.

  • How can I use a dll if I dont have a header file

    I'm not sure if I'm even trying the possible here as I have searched and not been able to find much at all.  However I figured it was worth asking here.
    I have access to several dll's used by a program, I need to open a file using the program (for some reason it is completely non responsive unless you open it "within" the program itself) and so decided to browse the .dll files included.  Ive found a few functions which may carry out the function I need.  Is there a way of figuring out the inputs/outputs if I don't have documentation or a header file?
    This is the next stage in a huge project I am working on at the moment and I've been banging my head against the wall all day trying to figure this out.
    Thanks in advance for any help
    Rik
    That glass?
    Thats glass is neither half full or half empty....
    Its twice the size it needs to be

    Yes, that makes sense. It also means that what you are trying to do is not likely to work. You have no way of knowing what the program does when opening the file, so guessing at using the DLLs is purely a shot in the dark without even knowing where the dark is. Even if you could find the function (assuming it's just one) that loads a file, how is the program supposed to use it now? That function has to be called from within the program. When you call it from LabVIEW you are not sitting inside the program's memory space, so it has no way of knowing about the file.
    I would suggest, instead, to see if the program accepts command-line parameters. For example, does it accept a name of a file to open as part of launching it from the command line? If not, then you may need to resort to trying to control it via automation. If it has no built-in automation then you need to resort to using the OS to make pretend you're clicking buttons and typing text. This has come up many times before, and there have been numerous posts on this, so please do a search on controlling an external program from LabVIEW within this forum. You can call the Windows API functions to move the mouse to a specific location and click the button as well as typing text, or you can use third-part automation tools. One that I have used successfully is AutoIt. The search I indicated will yield other suggestions. 

  • How to use preprocess​or directives (#define) in C++ header file with LabVIEW 8.2

    I have a C++ header file that contains around 2000 preprocessor directives:
    #define MEM_1   0xC
    #define MEM_2   0xD
    #define MEM_3   0x18
    I want to be able to "access" these memory offsets by identifier name (MEM_1) in my LabVIEW program like I would in a C++ program.  I do not want the overhead of parsing through the header file and storing all the offsets into an array or similar structure. 
    I've written a simple Win32 console program to return the memory offset given the identifier (see code below), and created a DLL to use with my LabVIEW program.  In the console program, you notice that I can call a function and pass in the identifer name, and get the offset back correctly:
    getOffset(MEM_1);
    In LabVIEW, I was hoping to be able to pass in the identifier (MEM_1) but was unsure what datatype to use.  In my C++ code, I defined the parameter as an int.  But in LabVIEW, I can't enter in MEM_1 as an int.   Can someone advise on how to do this?  Or if there is an alternate way to use #define's from external code inside LabVIEW?
    #include "stdafx.h"
    #include "scrmem.h"
    #include "stdio.h"
    void getOffset (int var);
    int _tmain(int argc, _TCHAR* argv[])
     getOffset(MEM_1);
    canf("%d");
     return 0;
    void getOffset (int var)
     printf("The address of MEM_1 is %x", var); 

    kaycea114 wrote:
    Hi,
    Where do you think I should use the string? 
    The way that getOffset is currently defined in the DLL, I have to connect an integer input into the LabVIEW function.  This prevents me from entering in: MEM_1 as the input to the LabVIEW function.
    Are you suggesting that I change getOffset to receive a String parameter ("MEM_1")?  Does that mean I need to do a string compare (line by line) through the header file to get the offset?  It seems like doing this search through the header file would degrade performance, but if that's the only work around, then I'll do it.
    Please advise.
    Well, what you want to do is indeed entering a string and getting back the assigned integer. That is what the C preprocessor is doing too although there it is done only once at the preprocessor stage of course and not at runtime anymore. But LabVIEW is not a C preprocessor.
    What you did so far seems to be to define getOffset() that accepts an enum that needs to be created from the C source code to then return the assigned constant. That's of course not very helpful.
    And writing a VI that could parse the C header file and create a name/constant array is really a lot easier than doing the same in C. You don't even need to parse the file each time again, but can instead cache them in an uninitialized shift register (LV2 style global).
    Even more easy would be to create from that data a ring control using property nodes and save it as custom control and voila you have the most direct lookup you can get in LabVIEW and it works just as comfortable as using the define in C code. It would mean that you need to seperate your header file possibly into several different files to only get related constants into the same ring control, but that is easily done.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Unzip files using ABAP program

    Hi All,
    Can anybody guide me how to Unzip a .zip file using ABAP program... Appreciate your immediate reply...
    actually, my scenario is to check whether zip file is created in appl.server or not.., and if zip file created then i need to check whether its blank file or any content exist inside the file...
    Thanks in advance
    Bhasker

    hi
    good
    parameters: command(236) lower case.
    data: std_lines(255) occurs 0 with header line.
      call function 'RFC_REMOTE_PIPE'
        destination 'SERVER_EXEC'
        exporting
          command = command
          read = 'X'
        tables
          pipedata = std_lines
        exceptions
          communication_failure = 1
          system_failure = 2.
    You should put your Unix command in the command parameter. "gunzip /yourfilepath/yourfilename" works on my Unix system. Once you determine the proper Unix command, you should be set. This technique is also nice because it provides you with echos back from Unix in table std_lines. For more complex Unix activity, you may want to consider throwing together a Unix script, and calling that via this code.
    reward point if helpful.
    thanks
    mrutyun^

  • Using header files with call library node

    I am writing an application for Palm PDA, and I use call library node to insert some C code written in Codewarrior 9 for PalmOS.
    For some reason, when I build the program for the Palm the builder does not recognise the functions declared in my header files.
    Please help me with this problem and tell me how do I create a header file in Codewarrior so the builder can include it in the Palm application!!!

    Hello
    Can anyone help me out?  I am trying to use a chart with a Sliding Region of intrest function. 
    I would like to be able to zoom in on the RIO and have the ability to zoom back out.
    I would also like to be able to set the initial mid point setting of the RIO slider.  The original file was using the delta T (psec) control to do this.
    I have only been experiementing with this number to see what value works.  If someone could explain what is going on with that control it would help.
    I noticed that when I move the RIO slider to the left all the way the value goes negative, I am not sure if the program stops reading the value
    at zero or not.....
    When you run  the select RIO Rev 4 vi set the DATA COL to PLOT to 1 to see the correct data
    Thanks in advacne
    Tim C.
    1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
    Attachments:
    Sliding ROI Rev 4.zip ‏111 KB

  • What is the meaing of the sysmbolic constant value in the header file for UIR file and how they are used

    In labwindows after creating the uir then header file is create automatically. There it has define some symbolic constant. As examples of colview.h(from the examples of labwindows )
    #define  MAINPNL              1       /* callback function: MainPanelCB */
    #define  MAINPNL_RESULTS      2     /* control type: table, callback function: ResultTableCB */
    #define  MAINPNL_NEWTEST     3       /* control type: command, callback function: NewTestCB */
    My question is how these values 1, 2 and 3  were selected and how they are used in programs ?
    If anyone explains, it will be a great help.

    When creating a UIR file, CVI editor takes care of assigning constants to the panels / controls you create in it.
    The conceptual framework is the following (assuming to treat the file you have reported in your message):
    - Within a single UIR file all panels have a unique ID, which is the one you pass to LoadPanel when loading a panel into memory. LoadPanel (0, "myfile.uir", MAINPNL); is then translated to panelHandle = LoadPanel (0, "myfile.uir", 1); , that is: "load the first panel in the uir file". The panel in memory is then assigned a handle, which is guaranted unique by the OS and saved in panelHandle variable
    - Addressing a control in a panel is done e.g. using SetCtrlVal (panelHandle, MAINPNL_NEWTEST, xxx);  , which again is translated to SetCtrlVal (panelHandle, 1, 3);  that is: "Set control #3 in the panel identified by panelHandle to value xxx".
    You must not modify the include file associated to the UIR as it is fully maintained by the IDE and is rewritten each time you save the UIR file.
    That conceptual framework has some advantages and some caveats:
    - You can load the same panel more then once in your program: each instance is independent from the others as each panel handle is unique; in some occasions it may be helpful, e.g. if you need to handle several identical equipments connected to your PC and you can load the same control panel for each unit connected maintaining each of them independent
    - If the panel handle is wrong, the system does not warn you of this as it does not know of the symbolic names you are using; if you try that SetCtrlVal command with a wrong handle you are trying to manipulate a control on a panel different from the one you intend: supposing actual panel idientified by the handle has control #3 the maximum you can expect is that you receive an error in case you pass e.g. a string to a numeric, but if controls are of the same type you have no errors or warning at all! This is particularly important when addressing controls on pages of a tab control: each page is really a separate panel with its proper handle that you must retrieve with GetPanelhandleFromTabPage command before addressing the controls on it
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Moving ipod files onto a mac WITHOUT using a program

    My computer recently crashed and I have a good 30 songs that are new from the itunes store since the last time I backed up my music files. I have a mac formatted ipod and want to be able to put the music on it back onto the computer, but want to do so without installing or using any programs (as sketchy programs is the reason my computer crashed).
    Does anyone know how to do this? I did it previously when transferring from a PC to a mac, but have since forgotten, but remember there being numerous help topics and explanations on how to go about this before the whole "use a program" fad started. I know it involves opening 'preferences' on the itunes menu so the ipod doesn't automatically update, but what happens next?
    Any help would be extremely appreciated.
    Powerbook G4   Mac OS X (10.4.3)   mac-formatted ipod video

    This link describes how to do it with and without third party software: "Two-way Street: Moving Music Off the iPod" http://playlistmag.com/help/2005/01/2waystreet/

  • Ther are PARAMETER LIST DISCREPANC​IES in the help file vs the NIDAQ.H header file for GPCTR_Read​_Buffer...

    PROBLEM: The function help file contains documentation for using GPCTR_Read_Buffer with 7 parmeters in the parameter list. The NADAQ.H Header file contains 8 parameters in the function declaration. Which is right? What is the correct parameter list and can an example be provided that shows how to use the function correctly? I am currently using DAQ ver 6.92 and a 6602 Counter Timer board in a buffered start/stop or ND_BUFFERED_TWO_SIGNAL_EDGE_SEPARATION_MSR application.

    Thanks for the response Filipe, I'll let you know how it goes. I only went into the header file because example code provided by NI ... paste ...
    iStatus = GPCTR_Read_Buffer(iDevice, ulGpctrNum, ND_READ_MARK, ulReadOffset, ulNumPtsToRead, ulTimeOut, &ulNumPtsRead, pulReadBuf);
    showed use of 8 parameters - in agreement with the header file and in disagreement with the on-line help file function documentation.
    Tom

Maybe you are looking for

  • E-Mail on iPhone problems

    E-Mail on the iPhone is useless! Setting up the POP account was a breeze. I can now get E-mail to show up in my iPhone inbox. The problem, "This message has not been downloaded from server." Next message, "Cannot Get Mail. The user name of password f

  • Cannot sync N70 with laptop via Bluetooth

    hi i bought a Safecom Bluetooth dongle [0] from Ebuyer for about 8 quid [1] and i cannot get my N70 to sync with my laptop via Bluetooth using Nokia PC suite. it all works fine with the USB cable. anybody got any ideas or has got this to work at all?

  • How do I find out what generation is my ipod touch?

    How do I find out what generation is my ipod touch?

  • R12 and Sun JRE question

    Just a quick question related to the Sun JRE and R12 .. We recently upgrade from 11.5.10.2 to 12.1.3 .. We are still in testing mode but everything appears to be working fine so far .. One thing we noticed is that we are using the Sun JRE 1.6_18 on o

  • What is the quickest way to delete personal info prior to recycling?

    We are downsizing and my trusty iMac (10 years old I think) has to go, what is the best way to delete personal stuff?