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