Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 9:29 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: passing string value from java to .exe file
PostPosted: Wed Oct 22, 2008 1:08 am 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:47 pm
Posts: 281
Has thanked: 0 time
Have thanks: 1 time

Dear All,

I'm having a problem to pass values from .class file to .exe file.
perhaps I search all corresponding dll files but I can able to know
the function. but I don't know how to pass values, I keep on searching
If anybody did such type of enhancement pls guide me


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: passing string value from java to .exe file
PostPosted: Wed Oct 22, 2008 1:09 am 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:53 pm
Posts: 229
Has thanked: 0 time
Have thanks: 0 time
Do you know JNI? This will let you interface Java to C/C++. If the .exe
file already exists, JNI will help put the String in a format that can
be sent across.

The other thing is to realize what a C/C++ string is an array of
characters (same as Java bytes) followed by \0

So,
Code:
char *test = "abcde";


is the same as
Code:
char *test = malloc (6);
test [0] = 'a';
test [1] = 'b';
test [2] = 'c';
test [3] = 'd';
test [4] = 'e';
test [5] = '\0';


Use the getBytes () method of String to get a byte array representation
of the String, and then add on the character \0. C will recognize this.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 video chat application in java
 Image Insert in Excel File Using POI
 ASP file structure
 navigating to database using java
 java mobile apps
 need help in java
 Read your gmail using Java code
 Search records from text file
 Java Programing to communicating port parallel
 Java Chat

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: Google [Bot] and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team