Can't get long from dll's struct with JNA!!!

Hi,
I have trade.dll witch contains structs and just informational fields. For example like this:
long getInstrumentCount ();
struct Instrument {
long id;
char MarketName[15];
char SectorName[15];
char GroupName[15];
char ShortName[15];
char Name[100];
double Open;
struct Instrumnet getInstrumentByNum(long)
Here is Java mapping:
public interface TradeDll extends StdCallLibrary {
public static class Instrument extends Structure
public static class ByValue extends Instrument implements Structure.ByValue { }
public Pointer id;
public byte[] marketName =new byte[15];;
public byte[] sectorName=new byte[15];
public byte[] groupName=new byte[15];
public byte[] shortName=new byte[15];
public byte[] name=new byte[100];
public double open;
long getInstrumentCount();
Instrument.ByValue getInstrumentByNum(long n);
So, getInstrumentCount and getInstrumentByNum work fine, but I can't get id value from returned stuct by getInstrumentByNum(long n).
First I've tried to declare id like just long but, it takes 8 byte and took 4 byte from next field. (I think in dll file for id field allocates only 4 bytes).
Second I've tried to declare id like NativeLong, but it returns "java.lang.IllegalArgumentException: Unsupported structure field type class com.sun.jna.NativeLong" exception.
Third I've tried to declare id like Pointer, but I couldn't get long value from Pointer. When I've tried get long with pointer.getLong(0) and pointer.getNativeLong(0) JVM prints "An unexpected error has been detected by Java Runtime Environment:
Fourth I've declared like this byte[] id = new byte[4], but long type in Java needs 8 bytes.
I'm sitting on this problem already 2 weeks!
Can anybody help me, please!
Thanks!

Here is my virtual instrument>>>>
Attachments:
SOLO_esib_problem_noreading.vi.vi ‏29 KB
Immagine.GIF ‏66 KB

Similar Messages

  • Can we get data from business views  in CR 2008/XI?

    Hi All,
    Can we get data from business views  in CR 2008/XI?
    If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
    Thank you,
    Krishna Pingali

    Hi Krishna,
    Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
    You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
    It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
    Contact our Sales department for pricing and availability.
    Thank you
    Don

  • How can i get contacts from my old Nokia phone to iphone 4S

    how can i get contacts from my old Nokia phone to iphone 4S?

    Appreciate the reply thank you
    Issue being is I don't have the lead for the samsung any longer but have the memory card?
    An yes I know I need to get them onto my MAC but how is what i'm struggling with?
    Any help would be appreciated.
    Many thanks

  • What RAM do I need and where can I get it from?

    Hi all,
    I know this is probably a simple question, but I just want to make sure I don't mess up my computer! I have an old school DV iMac, and bought the Mac OS X upgrade not too long after it came out (which is rather a while ago now!), but couldn't install it became I don't have enough RAM. And I obviously have just put it off and off. Now I'm at uni, and want the computer to work as well as it can for my mum, because she's even worse than me when it comes to computers. So, anyway, I need RAM. What type do I need and where can I get it from fairly cheaply? And how much would you recommend I get? My friend says he knows how to put it in, so all okay there hopefully/
    My computer's details:
    Processor info: PowerPC G3
    Machine speed: 400MHz
    OS: 9.2.2
    Built-in memory: 64MB
    I remember being able to get more details than this from somewhere on the computer, but I can't remember where...I haven't used it for 6 months or something, and am obviously getting forgetful.
    Hope someone can help. If you need to know anything else, tell me where to get the info from and I will tell you!
    Cheers,
    Fran
    DV iMac   Mac OS 9.2.x   It's lime green...ooh...

    Hi,
    I just bought some RAM from Crucial.
    If you go to www.crucial.com/uk and follow the Crucial Memory Advisor Tool, you should be able to find the RAM for your Mac.
    1 GB sticks are pretty good value at the moment (they've even gone down a few pounds since I bought mine a week ago) and if you enter this code (found it on aonther thread here) you might get a couple of pounds knocked off the total: CUSTOMPC
    There's also places like Kingston & Cancom to try, as well as Misco.co.uk. But Crucial select the recommended RAM for your Mac.
    Also, when you think you've found the right RAM and want to buy it, try the Apple agent chat, and double-check with them.
    Hope this is useful.

  • Can't get video from camera update / suggestions?

    As I think others have reported, I have lost my ability to participate in iChat AV video sessions, and any attempt produces a "can't get video from camera" error message. I am running OS 10.4.5.
    I have an extra internal hard drive with no OS on it, so I did a clean install of Mac OS 10.4 and iChat was back to working. I then applied all the Apple Software Updates to bring it up to 10.4.5 as well as any othe Security Updates and such, and it is still working OK as long as I boot off that OS.
    This tells me the problem cannot be in my Router or DSM Modem, I think.
    In the past, I have had ShowMacster and iGlasses installed on my original system, but I believe that I have uninstalled both of those properly. Still does not work.
    I DO have Apple Remote Desktop - Admin installed on this startup volume, and I cannot say for sure whether the problem may have started around the time I installed it. It's possible, I just wasn't keeping chronological records of installs back then.
    So, the GOOD news is that I can participate in any iChat AV session I want to be in as long as I have prior notice or enough time to reboot my G5 PowerMac under my second drive, but I still can't keep iChat AV open on my main drive and expect to be able to respond to impromptu invites to a video session.
    I thought I may have read that Apple Remote Desktop can create a conflict. If anyone knows, I would be all ears! Thanks for any suggestions.
    Jim Foster
    Hampton, Ontario, Canada
    Dual 1.8 Mhz G5 PowerMac   Mac OS X (10.4.5)  

    I believe I have solved the mystery of why I was getting the "can't get video from camera" error message. I had said earlier that I had Apple Remote Desktop (admin) loaded on my Mac but that I did not normally have this application open. What I failed to realize, though, was that for some reason I also had Apple Remote Desktop set to ON in my Sharing System Preferences pane. All I had to do was to uncheck this box and my ability to carry on video chats returned.
    I expect that somehow in the process of installing and running the Apple Remote Desktop application to access another Macintosh on my home network, I must have either manually or automatically caused Apple Remote Desktop to be turned ON as if I was wanting to allow some other Admin user to connect to my Mac. Doesn't make much sense to me, but I am happy with the solution.
    Jim Foster
    1.89 Mhz dual G5 PowerMac   Mac OS X (10.4.5)  

  • Got a new Samsung galaxy s3 and can't get messages from iphone users now. Don't have the old iphone to change the settings ! please help . need to know how I can get messages on my galaxy

    Can't get messages from iphone users on my new Samsung g allaxy and don't have my old iphone anymore ! Please help !

    Read here under no longer have device:
    http://support.apple.com/kb/ht5661
    Be aware, changing your Apple ID password doesn't always work, & can take up to 45 days to work.
    It's either that, or you call AppleCare & have them fix.

  • Lost my Iphone 4g, hooked up old 3gs, can't get messages from people who have me registered with ichat

    Anyone who I had previously used iChat with, can no longer send me texts now that I have had to downgrade back to a 3Gs.
    Lost my Iphone 4g, hooked up old 3gs, can't get messages from people who have me registered with ichat.
    My carrier (Rogers) says they have nothing they can do about it.
    Thanks in advance.

    Correction - iMessage, not iChat.  Too early....

  • Can you get upgrade from elements 10 to photoshop?

    Can you get upgrade from elements 10 to photoshop?

    They also send the emails just for registering PSE, as long as you agree to let Adobe spam you when you register. And sometimes it's possible to get the special upgrade price even when it's not officially on, if you call adobe sales and ask nicely. It depends on the sales rep you get.

  • How can I get values from listbox?

    Hi all,
    I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
    How can I get values from Pricelist listbox?
    Thanks for any suggestions or short sample code.
    Best regards,
    Andy

    Hi Andy
    Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
      Public Sub GetItemPriceFromOpenWindow()
            'this is assuming item master is open
            Dim oEdit As SAPbouiCOM.EditText
            oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
            SBO_Application.MessageBox(oEdit.Value)
            Dim oCmb As SAPbouiCOM.ComboBox
            oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
            SBO_Application.MessageBox(oCmb.Selected.Description)
        End Sub
    Hope it helps

  • HT203167 lost my hard drive how can i get songs from ipod back to new computer

    I lost my hard drive and want to get my music back on my new computer. How can I get songs from my ipod to my computer? I am afraid to sync it and losing what is on my ipod. Any help would be appreciated.

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.
    Use your backup copy to put everything back.
    If for some reason you have failed to maintain a backup, not good, then you can transfer itunes purchases from your ipod:  File>Transfer Purchases

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

  • Can't get playlists from one one computer to another.  Confident Home Sharing is turned on correctly.  Have imac and macbook Air and Lion.  Using smart lists.

    Can't get playlists from one one computer to another.  Confident Home Sharing is turned on correctly.  Have imac and macbook Air and Lion.  Using smart lists.

    Using Ethernet, I am attempting to stream the movies on my computer to my girlfriends computer through iTunes home sharing. I want to watch the movies that are on one computer on another.

  • Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How can I get music from old mac to new mac?

    How can I get music from old mac to new mac please?
    Can't seem to make Migration Assistant work. Doesn't ask about or transfer files.

    I just migrated into a new MBP from an old one.
    It did not bring the music over.  Apple's instructions are to use the Home Sharing feature of iTunes.
    Open iTunes on your old Mac.  Select Home Sharing under the Advanced menu.  Sign in.  Do the same on your new computer.  Then when the library appears under Home Sharing on the left-hand panel on your new computer's iTunes, you can select all and Add To Library.
    That's what Apple says, anyway.

Maybe you are looking for