标签:
按pb中正常DLL编写方式即可,主要是要注意两个pb直接的数据类型转换的问题。
powerbasic 中直接定义string类型参数,对应pb的blob类型
powerbasic中定义的定长字符串 string*n 或者anscii*n,对应pb的string类型,此时参数传递类型为BYREF 引用传递。
定义
FUNCTION myfun ALIAS "myfun"( BYVAL Matchstring AS STRING ) EXPORT AS STRING
声明
public function string replacenull (blob mainstring) library "mydll.dll" alias for "myfun"
定义
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 program END FUNCTION
声明
Function string MyFunction1( ref string abc ) library "mydll.dll"
标签:
原文地址:http://www.cnblogs.com/mybuilder/p/4326091.html