Subject | Using a DLL |
---|---|
Author | James N Hitz |
Post date | 2006-10-18T06:43:42Z |
Hello Everyone
I have an DLL containing a form with a TIB_Grid hooked up to a TIB_Query
linked to a TIB_DataSource.
I then export the following procedure:
. . .
procedure ShowIBOForm(
aConx: TIB_Connection;
tx: TIB_Transaction);
begin
try
frmIBO := TfrmIBO.Create(nil);
frmIBO.qryCountry.IB_Connection := aConx;
frmIBO.qryCountry.IB_Transaction := tx;
frmIBO.qryCountry.Open;
frmIBO.ShowModal;
finally
frmIBO.qryCountry.Close;
frmIBO.Free;
end;
end;
exports
ShowIBOForm;
. . .
I then use the DLL in an EXE application and it actually shows the form with
records on it:
At the interface section:
procedure ShowIBOForm(aConx: TIB_Connection; aTx:TIB_Transaction); external
'TestDLL.dll';
At the implemenation section inside some event handler:
ShowIBOForm(conx, tx);
Now the problem is that when I try to now close the main form, an Access
Violation exception is raised. "Tracing Into" the code takes me to the
following line:
IB_Components: 18085: SetTransactionState( OldStatus );
What is the best way to use DLLs with IBO?
Note: Since there seems to be no sample app showing how to use DLLs with
IBO, I will gladly contribute the one I am working on (just something small
using employee.fdb); or maybe someone else already has a working sample?
I am using Delphi 7 Enterprise, Windows 2000, IBO4.6.Bc
James N Hitz
I have an DLL containing a form with a TIB_Grid hooked up to a TIB_Query
linked to a TIB_DataSource.
I then export the following procedure:
. . .
procedure ShowIBOForm(
aConx: TIB_Connection;
tx: TIB_Transaction);
begin
try
frmIBO := TfrmIBO.Create(nil);
frmIBO.qryCountry.IB_Connection := aConx;
frmIBO.qryCountry.IB_Transaction := tx;
frmIBO.qryCountry.Open;
frmIBO.ShowModal;
finally
frmIBO.qryCountry.Close;
frmIBO.Free;
end;
end;
exports
ShowIBOForm;
. . .
I then use the DLL in an EXE application and it actually shows the form with
records on it:
At the interface section:
procedure ShowIBOForm(aConx: TIB_Connection; aTx:TIB_Transaction); external
'TestDLL.dll';
At the implemenation section inside some event handler:
ShowIBOForm(conx, tx);
Now the problem is that when I try to now close the main form, an Access
Violation exception is raised. "Tracing Into" the code takes me to the
following line:
IB_Components: 18085: SetTransactionState( OldStatus );
What is the best way to use DLLs with IBO?
Note: Since there seems to be no sample app showing how to use DLLs with
IBO, I will gladly contribute the one I am working on (just something small
using employee.fdb); or maybe someone else already has a working sample?
I am using Delphi 7 Enterprise, Windows 2000, IBO4.6.Bc
James N Hitz