thank you luke
but I don't understand why the following works as a whole program but not if the function alone is compiled with the shared option and then used as a dll
like the following, assuming that the function alone is saved as addl.bas and compiled with the shared option and then renamed from addl.exe to addl.dll
but I don't understand why the following works as a whole program but not if the function alone is compiled with the shared option and then used as a dll
Code: (Select All)
Dim As String a, b, c
a = "Hello"
b = " World!"
c = adds(a, b)
Print c
Function adds$ (x As String, y As String)
adds = x + y
End Function
like the following, assuming that the function alone is saved as addl.bas and compiled with the shared option and then renamed from addl.exe to addl.dll
Code: (Select All)
Declare Dynamic Library "addl"
Function adds$ Alias "_Z18FUNC_ADDSP3qbsS0_" (x As String, y As String)
End Declare
Dim As String a, b, c
a = "Hello"
b = " World!"
c = adds(a, b)
Print c