The declaration of my DLL in Pascal is this:<br>
FUNCTION F(s1:PChar; s2:PChar):INTEGER; STDCALL;
<br>The DLL performs some action depending on s1 and returns a response in s2. It does not modify s1. Usually s2 is not set on calling the DLL but it is here for debugging purposes.<br><br>This is the ThinBasic code I am using:<br>
Uses "trace"<br>
Uses "CONSOLE"<br>
<br>
Declare Function F Lib "FILE.DLL" Alias "F" ( ByRef s1 As Asciiz, ByRef s2 As Asciiz) As Long <br>
<br>
Dim Reply As Asciiz*1024 <br>
Dim p As DWord<br>
<br>
Reply="World" <br>
p=VarPtr(Reply)<br>
Console_WriteLine(F("Hello", Reply))<br>
Console_WriteLine(Reply)
In ThinBasic V1.8.9.0 I get this:
On calling the DLL, the value of p in ThinBasic is the same as the value of s2 in the DLL, and the contents of Reply in ThinBasic is the same as the contents of s2 in the DLL. On return from the DLL, the contents of Reply in ThinBasic is the same as the contents of s2 set by the DLL. So as expected.
In ThinBasic V1.10.7.0 I get this:
On calling the DLL, the value of p in ThinBasic is not the same as the value of s2 in the DLL, but the contents of Reply in ThinBasic <em>is</em> the same as the contents of s2 in the DLL. On return from the DLL, the contents of Reply in ThinBasic has not changed even though the contents of s2 in the DLL has been changed.
I will now test the ThinCore.Dll you sent.
Bookmarks