Hi all, I've just created a prototype TPC Dll for DBPro and all is working fine. However, I cannot work out how to update/modify the parameters passed to a TPC Dll.....example:
(I used Delphi and thanx to empty user for tutorial on this
)
Suppose I have a procedure which just increments three values passed from DBPro to the TPC DLL:
procedure TestProc(a,b,c: LongInt)
begin
inc(a);
inc(b);
inc(c);
end;
Now when this procedure is called from DBPro like so:
a = 1 : b = 1 : c = 1
TestProc(a,b,c)
print a;b;c
it is called fine...except the passed parameters are not changed when the call returns back to DBPro. (should print 222) ???
I understand the stringtable and all is fine in that department as I have a fully working DLL for the functions that return a single value. Only I cannot getting any procedures to work that pass variable parameters (by ref)......help please...
Delphi TPC code here:
library DBTestDll;
{
STRINGTABLE
Begin
1, "TESTPROC[%LLL%TestProc"
End
Above is Compiled to stringtable.res with DLL
}
uses
Windows,
SysUtils,
Math;
{$R *.res}
{$R stringtable.res}
{ String handling function pointer }
var
CreateDeleteString: procedure(OldString: PLPSTR; NewStrLen: DWORD); cdecl;
{ Called by DBPro immediately after loading the DLL }
procedure Construct; cdecl;
begin
end;
{ Called by DBPro before termination }
procedure Destruct; cdecl;
begin
end;
{ Called by DBPro after Construct }
procedure ReceiveCoreDataPtr(GlobCorePtr : Pointer); cdecl;
begin
@CreateDeleteString := Pointer(GlobCorePtr^);
end;
{ 1, "TESTPROC[%LLL%TestProc" }
function SpeedTestFunc1(a, b, b: LongInt); cdecl;
begin
//HOW DO YOU MODIFY THE PASSED PARAMETERS ?????
inc(a);
inc(b);
inc(c);
end;
{ Exported Functions and String Table Names for DBPro }
exports
Construct name '?Constructor@@YAXXZ',
Destruct name '?Destructor@@YAXXZ',
ReceiveCoreDataPtr name '?ReceiveCoreDataPtr@@YAXPAX@Z',
TestProc;
begin
end.