Hi all,
I've a routine in DLL (involving BDE operations like TTable navigation,
etc)
written in Delphi 2.01, and it works perfectly with a Delphi 2 EXE (it
better be).
However, when I try calling it from a VB5 compiled executable, it throws
out
a GPF whenever I tried to open a TTable object (I have left traces in the
DLL
routine and found out abt this). The DLL routine did not even have any
parameters, and it's compiled with "stdcall" calling convention. The codes
look something like this :
MYDLL.DPR
-------------------
library MyDLL;
uses
test in 'test.pas';
function MyRoutine : Integer; export; stdcall;
exports
MyRoutine index 1;
begin
end.
TEST.PAS
----------------
unit test;
interface
uses
SysUtils, DBTables, Dialogs;
function MyRoutine : Integer; export; stdcall;
implementation
function MyRoutine : Integer;
var
MyTable : TTable;
begin
try
MyTable := TTable.Create(Nil);
with MyTable do begin
DatabaseName := <MyAlias>;
TableName := <MyTableName>;
Active := True; (* GPF struck here ! *)
......................
......................
end;
......................
......................
finally
MyTable.Active := False;
MyTable.Free;
end;
end;
end.
Did I miss out anything important or is it a known problem of BDE ?
I'm using BDE 3.0 which comes with Delphi 2.01.
Thanks in advance,
Kenny