Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java µ÷Óà delphi±àдµÄdll


ÓÐЩʱºò,ҪдһЩ³ÌÐò,ÔÚ JAVA ÀïÃæºÃÄÑʵÏÖ, µ«Èç¹ûʹÓÃÆäËü±à³ÌÓïÑÔÈ´ÓֱȽÏÈÝÒ×ʱ,ÎÒÃDz»·Áͨ¹ý JNI À´Èò»Í¬ÓïÑԵijÌÐò¹²Í¬Íê³É.
JNI µÄ½Ì³Ì, ÍøÉÏ C µÄ±È½Ï¶à,Java Ò²ÌṩÁË javah.exe Ϊ C ÓïÑ﵀ JNI ³ÌÐòÉú³ÉÍ·Îļþ, Èç¹ûÄãÊÇÒ»¸ö Delphi ±à³ÌÔ±, ÄÜ·ñÈà JAVA Óë Delphi ³ÌÐò½»»¥ÄØ? ´ð°¸Êǿ϶¨µÄ,½ñÌìÎÒÃǾÍÀ´¿´Ò»ÏÂÒ»¸ö¼òµ¥µÄÀý×Ó.
Helloworld. Ö÷ÒªÊÇÀ´ÈÏʶһÏÂ, JAVA ÔõÑùµ÷Óà Delphi ³ÌÐòµÄ·½·¨.
ºÃµÄ,ÎÒÃÇÏÈÀ´´´½¨Ò»¸öÀà:
package alvinJNI;
class HelloWorld {
static {
System.loadLibrary("DelphiAction"); //µÈÒ»ÏÂÎÒÃǾÍÓÃDelphiÀ´±àÒ»¸ö³ÌÐò,±àºÃÖ®ºóÉú³ÉµÄÎļþ¾ÍÊÇ DelphiAction.dll ÕâÊÇÒ»¸ö¶¯Ì¬Á´½Ó¿âÎļþ,Õâ¸öÀàÀïÏÈÔÚ¾²Ì¬Óï¾ä¿éÖмÓÔØËü
}
public native void printText(); //ÉùÃ÷Ò»¸ö native µÄ±¾µØ´úÂë³ÌÐò,ÎÒÃÇʹÓõÄÊÇ Delphi À´±àд.×¢Òâ:Õâ¸ö·½·¨ÔÚÕâÀïÖ»ÊÇÉùÃ÷,²¢Ã»Óж¨Òå·½·¨Ìå,ÒòΪÕâ¸ö·½·¨ÎÒÃÇÒªÓà Delphi À´ÊµÏÖ.
public static void main(String[] args) {
//´´½¨¶ÔÏó²¢µ÷ÓÃÀïÃæµÄ native ·½·¨.
HelloWorld hw = new HelloWorld();
hw.printText();
}
}
ÀàдÍê±àÒëºó,½ÓÏÂÀ´µÄÊÂÇé¾ÍÓÉ Delphi À´½â¾öÁË
ÎÒÃÇÔËÐÐ Delphi ºóн¨ DLL ¹¤³Ì: file->new->other,È»ºóÔÚ new Ñ¡ÏÀïÃæÑ¡Ôñ Dll Wizard ¾Í´´½¨ÁËÒ»¸öÐµĹ¤³ÌÁË,
ÎÒÃÇÑ¡ÔñÒ»¸öÎļþ¼ÐÀ´±£´æ¹¤³Ì
ÔÚ±£´æ¹¤³Ìºó,ÎÒÃÇÐèÒªÏÂÔØ jni.pas ¼ÓÈëµ½ÎÒÃǵŤ³ÌÖÐ,ÕâÊǹúÍâµÄ¸ßÊÖдµÄ³ÌÐòµ¥Ôª,Ëü·½±ãÎÒÃÇµÄ Delphi ³ÌÐòÓë JAVA ½»»¥. ¿É´ÓÏÂÃæµØÖ·ÏÂÔص½:
http://www.blogjava.net/Files/alvin/jni_pas.zip
½âѹ֮ºóÀïÃæÓÐÁ½¸öÎļþ,½«Æä´æ·ÅÔÚ¹¤³ÌµÄĿ¼ÏÂ
½ÓÏÂÀ´ÎÒÃDZàд Delphi ´úÂë:
library DelphiAction; //ÕâÀïÉèÖö¯Ì¬Á´½Ó¿âµÄÃû³Æ,ÒòΪÎÒÃǸղÅд JAVA ÀàʱÊÇÓà DelphiAction,ËùÒÔÕâÀïÁËÒªÉèÖÃΪ DelphiAction
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be depl


Ïà¹ØÎĵµ£º

javaÐòÁл¯Óë·´ÐòÁл¯

±¾ÈËÔÚ½Ó´¥¹ý³ÌÖÐÓÐÁ½¸öÌû×ÓдµÄ²»´í£¬ÔÚ´ËÕûÀíһϣº
1.ÐòÁл¯
:½«¶ÔÏóת»¯³ÉÁ÷µÄ¹ý³Ì³ÆΪÐòÁл¯ 
   ·´ÐòÁл¯
:½«Á÷ת»¯³É¶ÔÏóµÄ¹ý³Ì³Æ֮Ϊ·´ÐòÁл¯
2.¶ÔÏóÐòÁл¯(Serializable)ÊÇÖ¸½«¶ÔÏóת»»Îª×Ö½ÚÐòÁеĹý³Ì£¬¶ø·´ÐòÁл¯ÔòÊǸù¾Ý×Ö½ÚÐòÁлָ´¶ÔÏóµÄ¹ý³Ì¡£
ÉÏÃæÕâÁ½¸ö½âÊͶ¼Í¨Ë×Ò׶®¡£
ÐòÁл¯¾­ ......

Java¾­Ñé×ܽá Swingƪ


ת×Ôhttp://blog.csdn.net/kabini/archive/2007/07/25/1707747.aspx
 
Ç°ÑÔ
±¾ÎÄÇ°ÑÔ²¿·ÖΪÎÒµÄһЩ¸ÐÏ룬Èç¹ûÄãÖ»¶Ô±¾ÎĽéÉܵÄJavaʵÓü¼ÇɸÐÐËȤ£¬¿ÉÒÔÌø¹ýÇ°ÑÔÖ±½Ó¿´ÕýÎĵÄÄÚÈÝ¡£
±¾ÎĵÄд×÷¶¯»úÀ´Ô´ÓÚ×î½ü½Ó¸øÈ˼ҰïæдµÄÒ»¸öС³ÌÐò£¬Ö÷ÒªÓÃÓÚ¹ÜÀí·ÖÆÚ¸¶¿îµÄ»õ¿îµÄһϵÁйÜÀí£¬°üÀ¨¹ýÆÚ¿îµÄ¼Í¼£¬¹ýÆÚ¿îÀûÏ ......

»Ø¹ËJava±à³Ì˼Ïëƪ£¨¶þ£©

4¡¢Ïú»Ù¶ÔÏó JavaÖв»ÐèÒª³ÌÐòÔ±×Ô¼ºÈ¥Ïú»Ù¶ÔÏó£¬ÕâÊÇΪʲôÄØ£¿ ÔÚC++ÖУ¬¶ÔÓÚ±äÁ¿¼°¶ÔÏóÉúÃüÖÜÆÚµÄά»¤Õ¼¾ÝÁË´óÁ¿µÄ±à³Ìʱ¼ä£¬ÒòΪ³ÌÐòÔ±ÐèÒªÖªµÀ±äÁ¿´æ»îµÄʱ¼ä£¬ÒÔ±ãÔÚÓÃÍêÖ®ºóÄÜ°ÑËüÏú»Ù£¬²»È»»áÕ¼ÂúÄÚ´æ¿Õ¼ä£¬×èÈû³ÌÐò¡£Òò´ËJavaÔÚÉè¼Æʱ¶Å¾øÁËÕâÒ»ÎÊÌâ¡£ÄÇôJavaÊÇÔõô×öµÄÄØ£¬¿´ÏÂÃæµÄ½éÉÜ¡£ 4.1¡¢±äÁ¿×÷ÓÃÓò ×÷ÓÃÓ ......

javaÖеļ̳Ð

1.¼Ì³Ð£ºÊÇÖ¸ÏÈ´´½¨Ò»¸ö¹²ÓÐÊôÐÔµÄÒ»°ãÀ࣬¸ù¾Ý¸ÃÒ»°ãÀàÔÙ´´½¨¾ßÓÐÌØÊâÊôÐÔµÄÐÂÀ࣬ÐÂÀà¼Ì³ÐÒ»°ãÀàµÄ״̬ºÍÐÐΪ£¬²¢¸ù¾ÝÐèÒªÔö¼Ó×Ô
            ¼ºµÄеÄ״̬ºÍÐÐΪ
            Óɼ̳жøµÃµ½µÄÀà³ ......

Java×ÔѧС½á——1

ÔÚѧУ×ÔѧJava£¬ÓõÄÊÇ¡¶Java³ÌÐòÉè¼Æ——Ò»ÖÖ¿ìѧ¿ÆµÄ·½·¨¡·¡£¿´ÁËÒÔºó·¢ÏÖ£¬°¡£¬ÕæÊÇÒ»±¾ºÃÊé¡£ËüÕæÊÇ¿çѧ¿Æ°¡£¬Êýѧ£¬ÎïÀí£¬ÉúÎïÎÊÌⶼ¿ÉÒÔÓÃJava×÷Ϊ¹¤¾ßÀ´Ñо¿¡£³ýÁ˸÷ÖÖÊýѧÎÊÌ⣬±ÈÈçËã·¨£¬µÝ¹é£¬Ëü»¹Ñо¿ÁËÎïÀíÎÊÌâ¡£ËüÉæ¼°Á˸÷ÖÖÎÊÌ⣬Éø͸ÀíÂÛ£¬»ùÒò×éѧ£¬Mandelbort¼¯µÈ¡£×îÅ£µÄÊÇ£¬ËüÓÃÆõԼʽµÄÉè¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ