Write a dynamic library for PowerBuilder using PowerBASIC

Source: Internet
Author: User

According to the normal DLL writing method in Pb, it is important to pay attention to the problem of two PB direct data type conversion.

PowerBASIC directly defines the string type parameter, corresponding to the PB blob type

The fixed-length string string*n or anscii*n, defined in PowerBASIC, corresponds to the PB string type, at which time the parameter pass type is passed as a byref reference.

Defined

FUNCTION myfun ALIAS "Myfun" (  BYVAL matchstring As String  ) EXPORT As String  

Statement

Public function String Replacenull (BLOB mainstring)  library "MyDLL.DLL" Alias for "Myfun"

 

Defined

FUNCTION MyFunction1     ALIAS "MyFunction1" (BYREF Param1 as  string *60) EXPORT As String MSGBOX "MYDLL. DLL has recevied: "+ (Param1)    function =" 1 "' Param1  ' return 1 to calling Programend function  

 

Statement

string string  ABC)  "mydll.dll"

 

Write a dynamic library for PowerBuilder using PowerBASIC

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.