Problem: Native method only works one

Hi, I have this class that calls the GetShortName method from the windows API.I have created the asociated DLL and everything went quite smooth.
My problem is that when I make a new object of the class GetShortNameA and use the method TranslateIntoShort(String) this only works the fist time.
The rest of the times I try to use this method with other arguments I am getting the same answer that I was getting the first time I call it.
Why can this be and how can I fix it??
I have tried declaring the TranslateIntoShort method non-static, but then the whole thing doesn't work (evena fter regenerating the h file and the DLL).
package alfagui_1;
public class GetShortNameA {
public GetShortNameA() {
static{
System.loadLibrary("GetShortPathNameA");
public static native String TranslateIntoShort(String LongName);
GetShortNameA ShortName = new GetChortNameA();
First time:
ShortName.TranslateIntoShort("C:\Mina Dokument\alfa")-->"C:\Minado~1\alfa"
Sucessive calls:
ShortName.TranslateIntoShort(WHATEVER)-->"C:\Minado~1\alfa"
Thanks for your help

Perhaps if you posted your code we could point out the problem?

Similar Messages

  • I added a contact to my iphone 4s and when I did a sync manually it is not showing up on my MAC in address book - please help....I checked off sync all contacts in iTunes  - does it only work one way from computer to phone?

    I added a contact to my iphone 4s and when I did a sync manually it is not showing up on my MAC in address book - please help....I checked off sync all contacts in iTunes  - does it only work one way from computer to phone?

    Is it because the new itunes looks different.
    View > Show Sidebar
    Then it should work just the same as on your old computer.

  • Lightning Connector Only Works One Way

    I have two lightning connector cables, and the new 30 pin to lightning adapter, all direct from Apple.
    I've found that if I plug them in one way, my iPhone won't charge, but, if I plug it in the other way, they work.
    It'sprobably a software issue, as the pins aren't being reassigned. I found that if I have the plug in, and it's not working, I can restart my iPhone 5, and the cable will begin working for this orientation, but not the other way.
    I've seen others mentioning this issue, but haven't found a solution yet. I've tried a hard and soft reset so far, and all that does is set the pins to work for one direction on the cable, not both.

    I recently tried resetting all my settings. This did not work either.
    The cable may appear to be charging, but no juice is flowing. If I reverse the cable, however, it starts charging.
    I can't be the only one with this issue, as it appears to be firmware related. There's a chance it's hardware related, but my iPhone was working fine for weeks, with all cables. Now, all my "reversible" lightning cables only work one way.

  • Problem: Bookmark sync only works in one direction

    I have 2 computer, computer A has vista and computer B is a netbook with XP. The problem is that the bookmark sycn only works in one direction.
    For example: both my computer has the same book marks (previously sync with X-mark which is now disabled). I decided to do some clean up on computer B. If Y sync computer A, nothing happens, but when I sync computer B, all the cleanup I made has been undone since computer A override all the changes I made to B.
    In other words, the changes I made to B can never be applied to A.

    When you're doing a "clean-up" like that you need to use '''Reset Sync''' in Tools > Options > Sync - Current Account = Manage Account and use the ''' ''Replace all other devices with this computer's data'' ''' option. See the attached screenshot - use the third option.

  • Strange font problem in Safari, only in one account

    Hi,
    Safari (3.2.1) renders small fonts on some pages incorrectly, but does so only on one user account. On nytimes.com, for example, the headlines are all fine, but the text is thin and hard to read.
    I have cleared caches, deleted User/Library/Preferences/com.apple.safari.plist, used Onyx to clear out various User caches, and checked to make sure I don't have Helvetica Fractions or Times Phonetic in my Font Book (these had mentioned as problems in various posts). In my own account, Firefox 3 renders those same texts correctly. So the problem seems to be isolated to Safari on one account. I would be grateful to hear if you can suggest a remedy.
    Best,
    Michel

    Hi Michel,
    Might be a problem with a local font, or settings within Safari's preferences.
    Within Safari, make sure your preference settings are correct.
    In the Appearance panel, default encoding is "Western (ISO 1), Standard and Fixed Width Fonts - I set mine to Skia. I believe the default font is Times. Either works fine.
    In the Advance panel, make sure the Style Sheet is set to "none".
    Outside of Safari, open Font Book from your Applications Folder. Highlight All Fonts, then scan the list. If you see any blue dots, that indicates a duplicate in your Font collection. You can remove the duplicates as follows: single-click on the first font listed, then Command/A keys to select "all". Then, go to the edit menu and select "resolve duplicates".
    Also, with everything still selected, in the File Menu, select "Validate Fonts". If errors appear, correct them by removing the corrupted font. Lastly, download a copy of Font Nuke. This will allow you to clean the Font cache.
    Post back

  • Can a monitor have a hardware problem so it only work on single resolution?

    I have an Apple MultipleScan 1705 connected to a PowerMac 7100. No matters what version of MacOS I use, no matters if I install updated Apple Displays SOftware, it will only work at 832x624 , any other resolution, lower or higher, will mess the image -it will be distorted an you will "see the refresh"-.
    I'm starting to think it is a monitor problem, but not sure. Any ideas?

    There is only one combination of Red, Green, Blue, HSync, and VSync that will run a high quality monitor.
    When you change the switches on your adapter, most of what you are doing is changing the wiring of pins 4, 7, and 10. These pins, and their connections with wires and diodes, are read by the Mac at startup to tell what family of genuine Apple displays is attached. (The code is like a promise that a certain display is being used.)
    The Mac uses this information, read at startup, to decide what resolutions and refresh rate are valid for the display you said is attached. No others are provided by your Mac, because they might damage your display.
    You have been focusing on the display as the likely source of the problem. I doubt that the display is the problem. The display is a slave. It takes the rows of dots given by the computer and attempts to paint them on the screen, and adjusts the frequency to match what the computer is sending if it can, and otherwise goes blank.
    If you take that same "adapter" and cable, and connect it to the Apple display, I expect you will get similar good results.

  • Google Account BlackBerry Sync only works one way

    Hey I just got my BB yesterday... I set up my Google Account on my BB and it downloaded all the data to my device. Then I set up an new Test-Contact and a Test-Appointment (calender) on my BB and it was synced to my google account... everything was fine... After that I set up another Test-Contact and Test-Appointment in my google account to check whether it would be synced to my BB... But that did not work at all... NOTHING WAS SYNCED... I waited for houres but it just would not sync the data to my BB... Same situation if I read or delete an Email in my google account the Email still appears as unread on my BB... But when I read one on my BB it appears as read on my google account... seems like sync is just working one way!
    Any ideas?

    I'm still new with BB, using it as a loaner phone when my Android got waterlogged.  I have the same problem, sort of - in my case, I noticed with Emails that it takes a good amount of time for one read on the BB to show as read in my Gmail.  And it's the same the other way except maybe a tad faster.
    But I'm not able to sync my google calendar any longer.  I read that google was dropping support for BB sync options sometime around 6/1/12, and somewhere in these support forums there's a thread on the topic, stating you can use your BIS account to get them to sync, and in looking for that thread I ran across your post.  If I find it, I'll come back and link to that thread.

  • NoClassDefFoundError problems -native method

    hi all,
    i've got a wierd problem... when i try to run a java appln ( for instance curl.java whose class is stored in a jar file) without giving a proper argument say like:
    java XX.RR.YY.curl
    a message prompts me to input a valid argument :
    Usage: XX.RR.YY.hyd <options>
    but when i try to run the same program - this time giving it a valid argument- like :
    java XX.RR.YY.curl -curltest.xml
    it spews out the following error messages along many others
    Exception in thread "main" java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:130)
    my point is why does java fail to find the class when i give it a valid argument and not when i do not give it any.
    thanks in advance

    exactly ... my java program has a similar code in it
    regarding the arg checking .
    so it does mean that java had found my appln
    class(yay! my classpath is right) and had run thru a
    few lines of code to get to the point where it
    realized it needed some arguments and so gently asked
    me supply an argument (a valid filename in my case)...Did you write this code? Did you put in the line where it displays the usage?
    so the next thing i do is run the same command java
    xx.xx.xx -curltest.xml ( i've supplied a valid
    argument this time ) ... the result :
    Exception in thread "main"
    java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:130)
    why did java fail to grab my appln class this time -
    in contrast to the first time where it found the class
    file w/o any problems. Try just using "java xx.xx.xx curltest.xml" (without the '-').

  • Sound only works one one headphone =(

    Hello I just bought a brand new hp pavilion dv6 computer with windows 7.. And I cant get the headphones to work properly! I only get sound on one headphone! I tried to update the drivers and I've tried to change to another pair but nothing works! Please help  

    - Apple will only exchange yur iPod for a refurbished one for:
    Apple - Support - iPod - Repair pricing
    - A third-party place like the following is less expensive. Google for more places.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    - You can purchase and use a pair of Bluetooth headphones.

  • I meet a  problem on rtp , Only use  one port in the project ,how to do

    the customer only permit we transmit and receive data on the same port . how to do this , I've never developed JMF & RTP before . And I meet problem , when i use the same port , it warning port is occupied .
    what should I do to solve this problem>? help

    If you want to use the same port to send and receive, youcan't use the same computer to test with. The port you choose will be bound by the sender, and will thus be unavailable for use by any other thread/process/program on the same computer.
    Use two computers, everything should work fine.

  • My browser keeps trying to create new tabs on clicks though I've followed the directions to fix the problem, but it only works for a while.

    Things will be working fine...then suddenly I start getting a new tab with every click. I've followed the directions to fix the problem, and usually deleting the mimes.pdf for a full reset works, but I'm getting tired of this. Everything is up to date as far as I can tell, and my virus and malware programs seem to find nothing wrong. I'm getting tired of this...help??

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • CS5 problem Adjustment layers only affect one layer instead of all

    I am getting this problem with Photoshop CS5 I think one of the settings got changed by accident but for some reason I cannot get any of the adjustment layers Levels,Curves etc to affect all layers under them. Instead it just changes the brightness of one layer only which is the one just below the adjustment layer but not all of the others. I use Photoshop for Digital art and I was all of the layers under the adjustment to change the look of the full image instead of just one layer. Is there any way of fixing this problem? I dont know what to do

    I think I know what the problem may be:
    When you're adding a new adjustment layer the following checkbox is coming on by default:
    You probably changed the default for this.  Here's how to change it back:
    Make the Adjustments panel visible by clicking the Window - Adjustments menu.
    Click the little fly-out menu icon at the upper-right.
    Clear the Clip To Layer checkbox.
    -Noel

  • IP phones only working one way

    Sorry, I'm a complete VoIP novice...
    We have a bit of a weird problem in that when you dial an extension which is our other office (connected by 2 x 2mpbs MPLSs) the caller can hear the recieving person's voice but the the recieving can't hear the caller. This happens both ways, i.e. when we call them and when they call us. We do have an access-list in place and I have opened up the ports that were logged as being denied when the calls were placed (namely 51000 range) and now nothing is being logged as denied.
    Apparently this has worked when initially tested, so I'm not sure what could have changed.
    Any ideas? Has anyone come across this before? We are using Avaya phones.
    Many thanks,
    J2026

    Thanks for your response Martin, much appreciated.
    1) I have removed all filters and re-tried: same result.
    2) Definitely connectivity is OK, OSPF routes in place, lots of traffic passes between the 2 regularly. Verifyied by ping as suggested.
    3)This could be an issue...I've looked at the interfaces in question, and some of them have a large amount of drops - input queues leaving from here and output queues from the other offices, e.g.
    Output queue: 0/1000/64/1067272 (size/max total/threshold/drops)
    However, I have cleared the counters and tried again, with same results, yet no more packets had been dropped.
    4) We currently only have 4 IP phones (1 at this site, 3 at other) as we are still setting it up. The problem is with all 4 phones, when going between offices. They work fine within the same office (to IP and standard analogue phones). Also, I can use the IP phone here to dial out to my mobile with no problems (this does not traverse the 2mpbs MPLS).
    We will be implementing some QoS queueing tools but I was under the impression that we should be able to get at least some, albeit choppy, audio working. Do you think it's likely/reasonable that this problem won't go away until proper queuing is implemented?
    Many thanks for your help.
    Regards, J

  • I have both a 1st generation AppleTV and 2nd Generation AppleTV, and my iTunes seems to only recognize one at a time - has anyone else had this problem - can you only use one at a time?

    Is this a design flaw?  Since the 1st Generation has a hard drive (140GB).  If both are on, only the 1st Gen get recognized. I would think you could use both at the same time.....  Help!

    Welcome to the Apple Community.
    Yes iTunes should work with them all together. Do they have different names, are they on the same network, have you noticed any other problems.

  • Windows Update on VMs seems to only work one at a time

    I have a handful of Win 2012 R2 VMs (running on ESXi) I've inherited. I've tried 3 or 4 times to update them now since taking them
    over, and noticed the strangest thing - only one of them will download updates at a time. If I start the update on all of them, the others will just hang at 0%. A little while after one finishes, another one will finally start to download. I'm completely stumped
    as to why/how this could be happening. Is this even possible, or just an incredibly strange coincidence? Is there anything I can check to prove one way or the other? I'm wondering if it's something odd like they were all cloned from one base VM in some odd
    way such that WU is seeing them as the same server when they try to connect or something... Other computers can connect to WU while this is happening; it's just this little cluster of VMs that were all built together.

    Hi Allison,
    Just addition. Did you check if those problematic VMs can access internet at the same time? For example, can
    those VMs browser any webpage successfully at the same time, not just download updates? Meanwhile, please check if there has policies on router ports to limit the number of MAC addresses per port.
    Hope this helps.
    Best regards,
    Justin Gu

Maybe you are looking for

  • I can see the shared library, but it will not open, need help

    I can see the shared library, but when I try to open it, after a few seconds of trying it throws me out.  Need help

  • Java servlet, DOM and xml help! please urgent!

    I have to write a servlet that takes the user input to build a xml document using DOM API and should be able to append new entry to that xml file whenever any user adds an entry. I have written the fillowing code, can anyone please take a look at thi

  • Non-latin language

    Hi all, I'm developing a website in croatian language, I usually use charset utf-8 and try to put characters codified in the code (for example è to let appear è in the page), but I can't find croatian characters code, I've seen they use combination l

  • Increase the Lead Column of Report Painter

    Hi Friends. I want to increase the Length of the LEAD COLUMN in order to type the particulars of Profit & Loss Accnt and Balance Sheet. There is an option under GRR2>Formatting>Report Layout>Lead Column. I am increasing the length after it is not tak

  • Gif files not displayed in external browser for Web interface builder

    Hello all, I have generated a bsp application and when i open it in my external broswer some of the gifs are not opening. icon_open.gif for variables,  navigation buttons up.gif, down.gif, s_b_delr.gif in excel based layout. I think its accessing the