Page 1 of 1

Problem with AssignConnection TMyConnection

Posted: Sun 29 Jul 2012 18:45
by maciejmt
Inside in DLL create new instance of TMyConnection.
By procedure pass instance of TMyConnection from main application.
When exit application, then raise Access Violation of memory error

DLL

Code: Select all

library Project2;


uses
  MyAccess,
  Windows,
  System.SysUtils,
  System.Classes;

var
  Conn: TMyConnection;

{$R *.res}

procedure LS_REP_DB(Connection: TMyConnection); stdcall;
begin
  Conn.AssignConnect(Connection);
end;

procedure Destroy(Reason: Integer);
begin
 if Reason = DLL_PROCESS_DETACH then
  Conn.Free;
end;

exports
  LS_REP_DB;

begin
  Conn := TMyConnection.Create(nil);
  DLLProc := @Destroy;
end.
APP

Code: Select all

type
  TForm2 = class(TForm)
    Button1: TButton;
    MyConnection1: TMyConnection;
    procedure Button1Click(Sender: TObject);
  private
  public
  end;

  procedure LS_REP_DB(Connection: TMyConnection);
    stdcall external 'Project2.dll' name 'LS_REP_DB';

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
  LS_REP_DB(MyConnection1);
end;
Delphi XE2 ; mydac71d16std
Example src: http://encodable.com/cgi-bin/filechucke ... ection.zip

Re: Problem with AssignConnection TMyConnection

Posted: Mon 30 Jul 2012 07:31
by AndreyZ
Hello,

Thank you for the information. We reproduced the problem and the investigation is in progress. We will notify you when we have any results.

Re: Problem with AssignConnection TMyConnection

Posted: Thu 02 Aug 2012 12:23
by AndreyZ
We have fixed this problem. This fix will be included in the next MyDAC build.

Re: Problem with AssignConnection TMyConnection

Posted: Thu 02 Aug 2012 16:07
by maciejmt
Thanks

Re: Problem with AssignConnection TMyConnection

Posted: Thu 02 Aug 2012 16:14
by AndreyZ
Feel free to contact us if you have any further questions about MyDAC.

Re: Problem with AssignConnection TMyConnection

Posted: Wed 08 Aug 2012 21:46
by maciejmt
Hi AndreyZ

My free updates expired on version 7.1.4.
Will it be possible to patch this version in this case ?

Re: Problem with AssignConnection TMyConnection

Posted: Thu 09 Aug 2012 08:38
by AndreyZ
In this case, to obtain the fix, you will need to renew your subscription. After subscription renewal you will be able to download the latest MyDAC version with this fix from Registered Users' Area.

Re: Problem with AssignConnection TMyConnection

Posted: Sat 18 Aug 2012 21:23
by mparak
Hi,
We are very keen on the resolution of this issue as we need to send the TMyConnection from our application to the dlls we created.
I realize that the matter has been resolved, but would love to know which version to use if we want to avoid this bug.

Please advise.

Regards
Mo
South Africa.

Re: Problem with AssignConnection TMyConnection

Posted: Mon 20 Aug 2012 05:18
by AndreyZ
We haven't released MyDAC since we fixed this problem. This fix will be included in the next MyDAC build.

Re: Problem with AssignConnection TMyConnection

Posted: Thu 20 Sep 2012 15:12
by robo
Hi,

I see MyDAC version 7.5 is now available for download.

Is this problem of passing a connection to a dll resolved in the new version?

If not, can you please recommend alternate methods to do so, especially on Delphi 7?

Thanks

Re: Problem with AssignConnection TMyConnection

Posted: Fri 21 Sep 2012 08:37
by AndreyZ
Yes, this problem is solved in MyDAC 7.5.9.

Re: Problem with AssignConnection TMyConnection

Posted: Tue 25 Sep 2012 08:11
by robo
Thanks.

Will upgrade and try it out.