Total members 11890 |It is currently Fri Apr 19, 2024 9:01 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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




Author:
Proficient
User avatar Posts: 280
Have thanks: 1 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.

_________________
Please recommend my post if you found it helpful


Author:
Proficient
User avatar Posts: 228
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : passing string value from java to .exe file
 Passing arrays as function parameter in java     -  
 Read file content to StringBuffer String object     -  
 Copy file to file in java code- implementation     -  
 Array Passing     -  
 Passing a Reference Variable     -  
 Passing an Argument to a Function by Value     -  
 JSP Passing Arrays to Methods     -  
 Passing Pointers to function example     -  
 How to remove special characters from a string in Java?     -  
 Passing Enum as Type Parameter to method     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com