Delphi calls Android's. so file

Source: Internet
Author: User

Original address: Http://zhidao.baidu.com/link?url=fzqefMM44ljXA5BnAbkX44SapCUteyzlXFvGLKvukBivm9AB-w39P_ H7ex1ty-gqx8j3a03azbpat6ymqjey4sc5jlaaymrvoigzcelm_ky

So nature is a dynamic link library
Compiling with GCC will generate

In Delphi XE

if  notTfile.exists (tpath.getdocumentspath+'/libserial_port.so') Then  beginShowMessage (Tpath.getdocumentspath+'/libserial_port.so not found'); End; Handle1:=loadlibrary (Pchar (tpath.getdocumentspath+'/libserial_port.so'));//Dynamic Loading StorageifHandle1<>0  Then //Find Librarybeginfun1:=getprocaddress (Handle1,'Openport');//Search for library functions add, and return function pointersifAssigned (FUN1) Then    begin......



As for the above Getdocumentspath or other directories can also refer to Tpath instructions and so file storage directory has a relationship

Another notable thing to pass in the string xe is the double-byte.

Delphi calls Android's. so file (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.