View Single Post
  #11   Spotlight this post!  
Unread 31-12-2010, 12:07
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Native C string (char*) to java String

changing the C sig to
PHP Code:
void ZomBDashboardGetStringViaArg(const charnamecharoutValue)
{
    
strcpy(outValueZomBDashboard::GetInstance().GetString(string(name)).c_str());

and the code in Get String to
PHP Code:
Pointer ptr Pointer.createStringBuffer(name);//arg
        
Pointer p = new Pointer(50);//50 should be enough for now
        
getstringfnc.call2(ptrp);//call
        
String str p.getString(0);//get our string
        
System.out.println("String:'"+str+"'"); 
still prints out
Quote:
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
String:''
...
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote